Afficher commentaires plus anciens
Hello, I'm trying to draw this function(F) on Mathlab, but I don't know which command to use.
L = (3/2).*(1E-10);
figure [x,y,z] = meshgrid(0:L/50:L,0:L2/50:L,0:L3/50:L);
F=sin(x)*sin(y)*sin(z)
Thank you for your help
Réponses (2)
Wayne King
le 14 Sep 2012
Modifié(e) : Wayne King
le 14 Sep 2012
Hi Lex, you haven't told us what L2 or L3 is here, but you have a few issues.
First
L = (3/2).*(1E-10);
0:L/50
What do you think the above creates? This will simply be 0 because you are saying "give me a vector which increments from 0 to basically 10^{-10} in steps of 1. So that will just give you a zero.
The other problem is that on the face of it you are creating an NxMxK array and a 3D plot is only going to work if your ultimate output
F=sin(x).*sin(y).*sin(z);
Is 2-D or a NxMx3 matrix.
Lex Ken
le 14 Sep 2012
0 votes
1 commentaire
Wayne King
le 14 Sep 2012
You did not address the fact that you are creating an "array" that consists of just 0. See my questions above.
Catégories
En savoir plus sur Develop Apps Using App Designer 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!