How to plot 3 variables in a function?

조회 수: 2 (최근 30일)
Karim Taha
Karim Taha 2014년 12월 13일
댓글: Karim Taha 2014년 12월 13일
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

답변 (1개)

Star Strider
Star Strider 2014년 12월 13일
Sliceomatic is a File Exchange contribution.
  댓글 수: 1
Karim Taha
Karim Taha 2014년 12월 13일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by