Answered
error for using *
Assuming that ‘D’, ‘b’, and ‘Gam’ are all the same sizes, do what the error message tells you and use .* instead of * for the mu...

6 years ago | 0

Answered
Index exceeds number of aray elements(2)
Try this: fun = @(c,Temp) (c(1)./((c(2)+Temp).^c(3))); The problem is that the code is fitting three paraameters, howiever ‘i...

6 years ago | 0

| accepted

Answered
Plotting data based on index
I would do something like this: y = (sin([1;2;3]*(0:26)*pi/13)).'; % Create Matrix x = 1:size(y,1); figure plot(x...

6 years ago | 0

| accepted

Answered
How to make this ode45 work?
Your equations must be set up as differential equations, using the Symbolic Math Toolbox diff function to create the derivatives...

6 years ago | 0

| accepted

Answered
How to conditionally delete columns in a cell array
Try this: inputc = {'A','B','A','A','A','A','A','A'; 'A','A','B','A','A','A','A','A'; 'A','A','A','A','A','A','A','A'}; isB =...

6 years ago | 0

| accepted

Answered
DFT of complex sine wave
You will need these functions: abs, angle, real, imag. I leave the rest to you.

6 years ago | 0

| accepted

Answered
How many coupled ODE's can DSOLVE handle? If no limit what is the time complexity on solution? For simplicity lets say N first order, linear ODE's.
‘From my experience as the level of coupling increases the time to solve increases dramatically.’ That’s specifically the rea...

6 years ago | 0

Answered
Solving for a single unknown and plotting.
Solving for ‘T’ is straightforward basic algebra: yd = [0.00 0.01 0.02 0.03 0.04 0.05] Tfcn = @(y) (1.5*y/d_x-0.5*(y/d_x).^3)...

6 years ago | 0

| accepted

Answered
How can I plot a horizontal line for a polar plot?
This plots the horizontal line: polarplot(acos(pError)./asin(pError) * 0.05/max(pError), 'LineWidth',1) %horizontal line at 5...

6 years ago | 0

| accepted

Answered
How to find Transfer Function using data points of channel pulse response?
It depends what the points are. You will need the System Identification Toolbox to identify it and estimate its parameters.

6 years ago | 1

Answered
Plotting Temperature as a function of y from an ODE
The ‘y’ matrix produced by the ode45 call is a (Nx5) matrix of column vectors. Also, since I assume that you want to plot ‘y(:,...

6 years ago | 0

Answered
How to convert y=f(x) to x=f(y)?
Try this: syms s x a=1; b=1.6; Eq = x == (b+a)/2+(b-a)/2*s; s=solve(Eq,s) producing: s = (10*x)/3 - 13/3 Without t...

6 years ago | 1

| accepted

Answered
how to solve equations
There were a number of errors in your code, and some may still exist. I corrected the ones I was certain of. In this (now ve...

6 years ago | 0

Answered
Solve the equation with variable
A bit of editing is in order, and a different optimisation function. Try this: eqn=@(x,h) 38.0657.*(( -x.*((3*0.6057194...

6 years ago | 0

| accepted

Answered
add header to figure
If you have R2018b or later, use the sgtitle function. For earlier versions, the File Exchange contribution suplabel will likel...

6 years ago | 1

| accepted

Answered
Displaying chracters with the given input number
I am not certain exactly how you want to use this function. Try this: dotsfcn = @(nrdots) fprintf([repmat('.', 1, nrdots), ...

6 years ago | 0

Answered
How can calculate R-Square using lsqcurvefit
You have to calculate it yourself, however the calculation (for vector independent and vector dependent variables) is straightfo...

6 years ago | 6

Answered
Counter for calculating the number of pulses in a signal from start to its peak
I do not understand what ‘does not work’ means. A description of the problem would be helpful. One thing I noticed is that...

6 years ago | 0

Answered
Piecewise function with function input?
I hope this is not homework. If it is, you cannot ethically use this solution. Break it up into its component functions, the...

6 years ago | 1

| accepted

Answered
How can I plot the function of Resistor Voltage Vr
You are almost there. Define ‘f’ as an anonymous function, vectorise it, and plot: % Define the value of R,C,L R = 1000; C...

6 years ago | 0

| accepted

Answered
Plot contour on similarity matrix
Use the surfc function.

6 years ago | 0

Answered
alerts to patch release
I am not aware of an email alert option. In the upper right corner of the MATLAB window there is a small bell ‘Notification’ ...

6 years ago | 1

| accepted

Answered
Display the terminal value on the plot
Try this: x=1:0.01:10; y=x+1; plot(x,y) text(x(end), y(end), sprintf('Terminal value of y is %.0f \\rightarrow', y(end)), '...

6 years ago | 0

| accepted

Answered
help me about namafile.wav pliss, im using matlab 2018a
Use the audioread function (R2012b and later releases).

6 years ago | 0

Answered
animation of the ODE
Try this: function dx = chetan(t,x,beta) dx = [ beta(2)-(beta(3)+beta(1)*x(2))*x(1); (x(3)*beta(4)*(x(1)^2)/(beta(5...

6 years ago | 1

Answered
ODE45 mesh grid
Use your ‘t’ vector as the ‘tspan’ argument: f = @(t,x) [-x(1)*x(2);x(1)*x(2)-x(2);x(2)]; t=0:0.001:6; [t,xa]=ode45(f,t, [4 ...

6 years ago | 0

| accepted

Answered
How to Find the period of a periodic function
Use the Signal Processing Toolbox findpeaks function: a=1; b=1; c=0.1; d=0.1; RHS=@(t,y)([a*y(1)-b*y(1)*y(2); c*y(1)*y(2)-...

6 years ago | 0

| accepted

Answered
can you change fraction to decimal when using linsolve
Depending on the result you want, either: X = double(linsolve(A,B)); or: X = vpa(linsolve(A,B)); .

6 years ago | 1

Answered
Error when adding multiple legends to graph
The only way to do what you want is to plot each ‘HIT’ value individually in a for loop: hold on for k = 1:numel(HIT) q(...

6 years ago | 0

| accepted

Answered
File missing after updating license
That information is likely in your preferences file. It should still exist, so you will need to find it and copy it to your cur...

6 years ago | 0

Load more