fplot command makes plot white
1 回表示 (過去 30 日間)
古いコメントを表示
Hello ,
I have for example a function like M1z = @(x) F1*x - I1*(x-l1/2) ; and Ixx = @(x) (bx+c)^4/64 ; and i write
Sxx =@(x) M1z*(bx+c)/2/Ixx ; and then i type
fplot(SXX1,[0 1.5],'b')
hold on
fplot(SXX2,[1.5 3],'b')
hold off
grid on
but the plot is only white how can i fix this; I dont want the option to make x and array and then plot it
0 件のコメント
採用された回答
Steven Lord
2019 年 11 月 11 日
Those ought to throw an error. You can't multiply a function handle and a number. You can multiple the result you receive from evaluating a function handle and a number, however.
% Arbitrary values for the variables used in the anonymous functions
F1 = 2;
I1 = 3;
l1 = 4;
b = 5;
c = 6;
M1z = @(x) F1*x - I1*(x-l1/2);
% I assume bx should be b*x otherwise Ixx doesn't depend on x
Ixx = @(x) (b*x+c)^4/64;
% Evaluate M1z and Ixx at x and use the results in evaluating Sxx at x
Sxx =@(x) M1z(x)*(b*x+c)/2/Ixx(x);
fplot(Sxx,[0 1.5],'b')
This issues a warning. You probably want to vectorize Sxx and Ixx using element-wise multiplication, division, and power (the .*, ./, and .^ operators instead of the *, /, and ^ operators.)
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!