How to plot x(i+1,j+1) with respect to i,j from the given data ,code shown in the body?
이전 댓글 표시
clc;
close all;
clear all;
A1=[0 -.75;-1 0];
A2=[.27 0;0 0];
A3=[0 -.001;0 0];
x(1,1)=1
x(1,2)=2
x(2,1)=1
for i=1:2
for j=1
z=x(i+1,j+1)==A1.*x(i,j+1)+A2.*x(i+1,j)+A3.*x(i,j)
end
end
[i,j]=meshgrid(2:3,2)
surf(i,j,z)
[EDITED, Jan, please format your code]
댓글 수: 4
Guillaume
2014년 10월 12일
Please format your code, using the {} code button.
Also, please explain what you're trying to do with that line:
z=x(i+1,j+1)==A1.*x(i,j+1)+A2.*x(i+1,j)+A3.*x(i,j)
At the moment you're checking if x(i+1,j+1) is equal to the expression on the right, and putting the result (0 or 1) in z. It's not going to work since x(i+1,j+1) is not defined, but I'm sure that's not what you intended anyway.
Image Analyst
2014년 10월 12일
Abhay
2014년 10월 12일
Jan
2014년 10월 12일
"Is not working" is not useful. Please explain any details.
채택된 답변
추가 답변 (2개)
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!