Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how to solve Error using * ?

1 回表示 (過去 30 日間)
thar
thar 2014 年 4 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
how to solve this problem?
>> syms x
>> y = 0.0002*exp(-2.3077*x).*cos(7.0753*x)+0.0612*exp(-2.3077*x).*sin(7.0753*x)-0.0502*cos(0.35493*x)+.483;
>> diff(y,x,2)
ans =
(316198015299*cos((35493*x)/100000))/50000000000000 - (250931707863*cos((70753*x)/10000)*exp(-(23077*x)/10000))/125000000000 - (682803412259*sin((70753*x)/10000)*exp(-(23077*x)/10000))/250000000000
>> x = [0:0.0001:5];
>> p = (316198015299*cos((35493*x)/100000))/50000000000000 - (250931707863*cos((70753*x)/10000)*exp(-(23077*x)/10000))/125000000000 - (682803412259*sin((70753*x)/10000)*exp(-(23077*x)/10000))/250000000000;
Error using *
Inner matrix dimensions must agree.

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 4 月 25 日
編集済み: Azzi Abdelmalek 2014 年 4 月 25 日
syms x
p = (316198015299*cos((35493*x)/100000))/50000000000000 - (250931707863*cos((70753*x)/10000)*exp(-(23077*x)/10000))/125000000000 - (682803412259*sin((70753*x)/10000)*exp(-(23077*x)/10000))/250000000000;
z=0:0.1:5
out=double(subs(p,z))
plot(z,out)
  2 件のコメント
thar
thar 2014 年 4 月 25 日
編集済み: thar 2014 年 4 月 25 日
I'm tying to use this code to plot the graph
>> x = [0:0.0001:5];
>> p = -40327871461/7812500000*exp(-23077/10000*x).*cos(70753/10000*x)+210444021533/125000000000*exp(-23077/10000*x).*sin(70753/10000*x)+3094107371/500000000000*cos(3511/10000*x);
>> plot(x,p)
>> grid
so that i want to assign values for p
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 4 月 25 日
Look at edited answer

製品

Community Treasure Hunt

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

Start Hunting!

Translated by