سؤال

I have solved a Differential equation(Iteratively, not using a matlab solver) in a rectangular Domain of Length [0 1]x[0 2] and stored the values in Matlab Array. I now want to plot it in contourf but the axis labels are still the matrix index (i,j). How do I change them to 0,1 and 0,2 .... tried already axis( ).

هل كانت مفيدة؟

المحلول

data = randn(8,9); %// example data
xlim = 1; %// choose as needed
ylim = 2; %// choose as needed
contourf(linspace(0,xlim,size(data,2)), linspace(0,ylim,size(data,1)), data)

Example graph:

enter image description here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top