Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How do you solve this equation in Matlab?
beta=0:10:90
sin(tetha)+(3*cos(tetha)-1)*cot(beta)=0
Solve for tetha
I used the solve function but didn't get any answer.
Check out fzero.
beta = 0:10:90
for ii = 1:numel(beta)
%% insert fzero function here
end
Columns 1 through 7
-0.9273 0.8777 -0.6248 -0.2930 0.8045 -0.9177 0.9141
Columns 8 through 10
-0.7869 0.2148 0.6605
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
t=-10:0.001:10
x=sinc(t);
subplot(321)
plot(t,x)
title 'orignal sinc wave'
%x(-t)
a=sinc(-t);
subplot(322)
plot(t,a)
title 'negative'
b=(x+a)*1/2;
subplot(323)
plot(t,b)
title 'even part of the signal'
c=(x-a)*1/2;
subplot(324)
plot(t,c)
title 'odd part of the signal'
d=c+b;
subplot(325)
plot(t,d)
sinc(t) is a symmetric function, so x=sinc(t)=sinc(-t)=a, thus, your panel 4, c=(x-a)*1/2 yields exactly 0 for all t values.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
syms k
S1 = symsum(1/((2*k)+1)^2,k,0,1000)
The result is this
59039372973827482202940226722672826425297321906316082356858983822169051832268260251807527611479190413293513875429587706186073872918905490907386679472102966658686481651660967093301512141946288248492833396616338323741632085379508599235923841007033467883638349122388806376761808189104503262045883240287482992169819848342303098664924237976221795758421152603069387903705445513260596627332283139648508194960733619500093010571517561429904500013876585156927070119332440687162376758374919870699278800835146651318465663183182583101377584105366558079836223068786457324044080570317649838092783113721959819118571747662368360095513856052974454509201490370810246175872510881504730747209788019551000695511879992198550955686739483474761130248789609061549535677663474218135370195381615899214931316241080337028498241295985409686314819267606796712968280842464845294917738460317179001491697993067157425958639996885239616893392960282441289069600101430806922004624472226999315951355963789249300352610312601262349650287009275097201871774652260892220551489305368617001974326978428202443548923140478853569492070442010110016068635424791389124439271253578545895132216218268847919848655110002938693346760862649668457282775860633067627110099340660770861888592018701206483696615682617062811616008107086256694453990688805738127607846586853460003073465075155412119309273843527076321601670400373937698518621100907936577387919537592519265365346619712200304996044229704602647674114176291753575322917531444831938509001759491229575945273985556769609288625450013634760596805884195325794441020339210402987018058377081579351119704065092777310976461961832919116412535470810011337916688085616171422473409544885864650134157327448050685723673514545806331081542320899927
It is a number in this form a/b
Why is this happening??
Do you know how to do this in octave too?
k = (0:1000);
k_sum = sum(1./((2*k)+1).^2);
disp(k_sum)
It's interesting that you jumped straight to using syms when the basic matlab functions work perfectly well for this problem. Why is that?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have the following data:
T=[0,100,300]
and
a=[2.8796,2.8785,2.886]
and I want to extrapolate and know what a will I get at T=600 in Matlab.
How can I do that?
If its linear the code below solves this
clear all
close all
T=[0,100,300];
a=[2.8796,2.8785,2.886];
reg = polyfit(T,a,1);
figure
hold on
plot(T,a,'bx')
plot(T,reg(2)+T.*reg(1),'k-')
plot(600,reg(2)+600*reg(1),'ro')
plot(600,interp1(T,a,600,'linear','extrap'),'md')
legend('observations','lin. regression','pred. at 600p polyfit','pred. at 600p interp1')
val_polyfit = reg(2)+600*reg(1)
val_interp1 = interp1(T,a,600,'linear','extrap')
diff = val_polyfit/val_interp1
yields
val_polyfit =
2.8924
val_interp1 =
2.8972
diff =
0.9983
For Linear Interpolation:
aextra = interp1(T,a,600,'linear','extrap')
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I want to know is it possible to make multidisciplinary function handle in MATLAB and if possible, how can I do this.
I assume you mean a "multivariate function" since a "multidisciplinary function" is completely non-nonsensical.
f=#(x,y)x+y
f(3,2)
ans =
5
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Im using matlab for the first time and im trying to input this matrix:
im using petercorke toolbox
can anyone help please
i know it must be obvious but im drawing a blank
You should start using the Matlab Documentation-there you can find all the basics!
Creating matrices in Matlab
A=[-0.7071 0 -0.7071; -0.7071 0 0.7071; 0 1 0];