How to plot x(i+1,j+1) with respect to i,j from the given data ,code shown in the body?
Mostrar comentarios más antiguos
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 comentarios
Guillaume
el 12 de Oct. de 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
el 12 de Oct. de 2014
Abhay
el 12 de Oct. de 2014
Jan
el 12 de Oct. de 2014
"Is not working" is not useful. Please explain any details.
Respuesta aceptada
Más respuestas (2)
Categorías
Más información sobre Graphics Performance en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!