Réponse apportée
How to make an anonymous function whose variable is itself a function of another variable?
Salman, use phi = @(x) x.^3 + 4*x.^2 + x + 3; z = @(x) cos(phi(x)).^2 + 4*sin(phi(x)).^2; z(3) ans = 1.039526660...

presque 12 ans il y a | 1

| A accepté

Réponse apportée
Why is this contradiction happening?
Use alpha = str2num(answer{1}) instead. |answer{1}| is a string that needs to be converted first.

presque 12 ans il y a | 0

| A accepté

Réponse apportée
using math operation as string in array on an expression
yonatan, you are on the right track: carray = {'3+4','3/4'}; res = eval(carray{2}) res = 0.750000000000000

presque 12 ans il y a | 0

| A accepté

Réponse apportée
How do i manage the number of input dialog box according to the user's choice?
DIJESH, you could use something like prompt = 'Enter data: '; title = 'Data input'; dlg_ans = inputdlg(prompt,title,[...

presque 12 ans il y a | 0

| A accepté

Réponse apportée
How do i get multiple outputs in one dialog box?
DIJESH, do you mean something like x = 3; y = 4; z = 2; h = msgbox({['x = ',num2str(x)]... ['y = ',num2str(y...

environ 12 ans il y a | 2

| A accepté

Réponse apportée
How do i understand the output of a solve function?
Mikkel, use X = vpa(solve(1*cos(gamma-eta)-1.2*cos(x-eta),x)) Y = vpa(solve(1*sin(gamma-eta)-1.2*sin(x-eta),x)) instead...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
??? Undefined function or variable 'blur' Why is that
Shehan, the error message seems to indicate that MATLAB is not able to determine the number of frames in nFrames = shainObj....

environ 12 ans il y a | 0

Réponse apportée
How do I plot a particular solution (with given initial conditions) of 3 differential equations with 3 variables?
Andrew, use |ode45| and something like function Lorentz() sigma = 1; r = 1; b = 1; [~,S] = ode45(@EOM,[0 50]...

environ 12 ans il y a | 0

Réponse apportée
spike genartion between time 0 to 1
Abhijit, use t = 0:100; d = zeros(1,numel(t)); d(t>=50 & t<=55) = 1; plot(t,d);

environ 12 ans il y a | 0

| A accepté

Réponse apportée
index must be a positive integer or logical
Sabrina, difficult to say without seeing the code. However, in MATLAB indexing starts with 1, not 0: >> a = [4 3 2 1] a = ...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
how can i print 2 function?s results ?
Elia, you need to call the function, e.g., [X,niter] = bisection2([1,3],1e-6) Also, I assume the function |f| is properly...

environ 12 ans il y a | 1

| A accepté

Réponse apportée
How to sum a specific number of observations through an entire dataset ?
TRAILOKYA, if it is a numeric array use |reshape| m_result = sum(reshape(m,75,[]));

environ 12 ans il y a | 0

| A accepté

Réponse apportée
diff() scales the amplitude
Jonas, |diff| only calculates the differences between adjacent elements, the |dy|. To get the derivative you need to devide by |...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
Please explain the above commands,
Ramya, |dd| contains the position numbers of all elements in matrix |a| that are smaller than 4, which would be 3, 2, and 1. ...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
How do i select data to legend in a plot ?
Blaise, use data1 = 10*ones(10,4)+randn(10,4); t1 = (0:1:9); figure(); p1 = plot(t1,data1,'bo'); hold on data2 ...

environ 12 ans il y a | 5

| A accepté

Réponse apportée
hello,everyone.I'm new here.how can i get the whole answers of an one yuan polynomial equation using fsolve?thank you so much
How about syms x sol = solve(x^7 + 2*x^5 + 3*x^3 + x + 7==0) As described in the documentation, |fsolve| can only hand...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
How do I simulate simulink model using the ode45.m function at the command prompt or in an m file?
Osman, how about doing it all in Simulink? <</matlabcentral/answers/uploaded_files/12651/Unbenannt.PNG>> If you select...

environ 12 ans il y a | 1

Réponse apportée
Why is the word "and" coming up in my output?
Lucy, for example, in the expression for |y5| there is a term cosh(p)*cosh(q)&cosh(t) (typo?) which results in an |and|. ...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
Are all add on products of Student version of MATLAB R2014a valid permanently?
Meghna, see the answer to your other question. In short, you can use all products (including add-ons) of/to the Student version ...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
I have purchased MATLAB Student Version. For how long the license is valid for this version?
Meghna, the MATLAB student version is a perpetual license. Which means you can use it indefinitely, as long as you are a student...

environ 12 ans il y a | 3

| A accepté

Réponse apportée
using for loop with 2 variables.
Sermet, use a = [1;2;3;4] b = [5;6;7] kk = 1; for ii = 1:4 for jj = 1:3 x(kk) = a(ii) + b(jj) kk =...

environ 12 ans il y a | 1

| A accepté

Réponse apportée
ODE45 for a system of diff eq with a vector eq
Barbara, check out function odetest() [t,y] = ode45(@rigid,[0 12],[0 0 0]); plot(t,y) end function dy = rigid(t,y)...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
how to change command window display options
GCE, try format compact

environ 12 ans il y a | 0

Réponse apportée
How do I convert the weird magnitudes in the results to zero ?
JMS, use something like data = [1 2 NaN; 3 NaN 4]; data(isnan(data)) = 0;

environ 12 ans il y a | 1

Réponse apportée
Finding index for minimum value in array
Bathrinath, use [val,ind] = min(pbest(~ismember(pbest,0))); or, the more general approach val = min(pbest(~ismember(p...

environ 12 ans il y a | 3

| A accepté

Réponse apportée
how to multiply each of the array with another set of array
Grace, use a = [1,2,3,4]; j = [1,2,3]'; b = bsxfun(@power,a,j);

environ 12 ans il y a | 1

| A accepté

Réponse apportée
sine wave max - min replacement
Zacharias, use something like x = 0:0.1:7; y = sin(x); y(y==max(y)) = y(circshift(y==max(y),1,2));

environ 12 ans il y a | 0

Réponse apportée
How to use more that one initial conditions In ODE45
Velmurugan, see this <http://www.mathworks.de/matlabcentral/answers/118837-how-to-add-trajectory-into-a-phase-plane#answer_12589...

environ 12 ans il y a | 0

Réponse apportée
how to change it?
Shi, check out fileID = fopen('num.txt','w'); while (i<10) x = input('enter the number: '); if isreal(x) ...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
Change time of a matlab simulation
Kelilah, you could use something like: dt = 1; T = 100; t = 0:dt:T; x1 = 1:100; y1 = sin(x1); plot(x1,y1,'b--') ...

environ 12 ans il y a | 0

Charger plus