Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

how to solve Error using * ?

1 visualizzazione (ultimi 30 giorni)
thar
thar il 25 Apr 2014
Chiuso: MATLAB Answer Bot il 20 Ago 2021
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.

Risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 25 Apr 2014
Modificato: Azzi Abdelmalek il 25 Apr 2014
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 Commenti
thar
thar il 25 Apr 2014
Modificato: thar il 25 Apr 2014
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 il 25 Apr 2014
Look at edited answer

Questa domanda è chiusa.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by