How to plot 3 variables in a function?

2 visualizaciones (últimos 30 días)
Karim Taha
Karim Taha el 13 de Dic. de 2014
Comentada: Karim Taha el 13 de Dic. de 2014
Hello,
I realize the question I'm asking has been asked a dozen times before but I don't think it applies to my situation.
I'm suppose to plot the following function:
I know E1, v1, E2, v2
I read something about mesh and sliceomatic
I did that but I still get an error saying
"Undefined function 'sliceomatic' for input arguments of type 'double'.
Error in Bonus_1 (line 25) sliceomatic(a,F,D,X)"
Here's the full code: (d1 is D and d2 is X)
%Bonus 1 %Clear command window and variables clearvars; clc; % Material one: Steel v= 0.27~0.3 E=200 GPa % Material two: copper v= 0.355 E=110~128 GPa %Source: http://www.engineeringtoolbox.com/metals-poissons-ratio-d_1268.html
v1 = 0.27; v2 = 0.355; E1 = 200e9; E2 = 110e9;
F = 1:1:200; D = 0.01:0.02:1; X = 0.01:0.02:1;
% create a meshgrid [Fmesh,Dmesh,Xmesh] = meshgrid(F,D,X);
% compute the function value at the meshgrid points a = ((3.*Fmesh/8).*((((1-(v1).^2)/E1)+((1-(v2).^2)/E2))/((1/Dmesh)+(1/Xmesh)))).^(1/3)
% launch sliceomatic sliceomatic(a,F,D,X)
The first time around I did not include ".*" and ".^" but it asked me to, so I did. Thanks in advance

Respuestas (1)

Star Strider
Star Strider el 13 de Dic. de 2014
Sliceomatic is a File Exchange contribution.
  1 comentario
Karim Taha
Karim Taha el 13 de Dic. de 2014
I noticed, but I didn't know how to use it. I opened the file and then tried running my code again. The plotting popped but and it was a line. I think the professor mentioned that was incorrect and it should be a surface. Sorry, I'm not really advanced in matlab so if you can give me thorough details that would be great.

Iniciar sesión para comentar.

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by