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

采纳的回答

Steven Lord
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 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by