How to plot x(i+1,j+1) with respect to i,j from the given data ,code shown in the body?
Show older comments
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 Comments
Guillaume
on 12 Oct 2014
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
on 12 Oct 2014
Abhay
on 12 Oct 2014
Jan
on 12 Oct 2014
"Is not working" is not useful. Please explain any details.
Accepted Answer
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!