How to plot x(i+1,j+1) with respect to i,j from the given data ,code shown in the body?
Afficher commentaires plus anciens
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 commentaires
Guillaume
le 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
le 12 Oct 2014
Abhay
le 12 Oct 2014
Jan
le 12 Oct 2014
"Is not working" is not useful. Please explain any details.
Réponse acceptée
Plus de réponses (2)
Catégories
En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!