문제

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