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