Answered
Cannot Substitute numeric values to a sym expression due to different number of elements
The easiest way to deal with that is to save it as a cell array, and then sort out the results later — theta_s_t{i} = subs(the...

4 years ago | 0

| accepted

Answered
Find exponent of equation
Try something like this — P = rand(10,1); % Create Data B = rand(10,1); ...

4 years ago | 1

Answered
How can you Convert Sym to Double when the sym has already been numerically solved?
Use the double funciton.

4 years ago | 1

| accepted

Answered
showing contour values on plot
The fcontour function does not have a 'ShowText' property, so overplot it with a normal contour plot and set 'ShowText','on' to ...

4 years ago | 0

| accepted

Answered
Finding the gradient of the function
Symbolically — syms a11 z1 sympref('AbbreviateOutput',false); k1 = atan(((0.02 + a11)./z1)) + atan((0.03 - a11)./z1) grad_...

4 years ago | 0

| accepted

Answered
I have query in graph plotting.
Using fsurf — G = @(a11,z1) atan(((0.03 + a11)./z1)) + atan((0.05 - a11)./z1); G1 = @(a11,z1) atan(((0.03 + a11)./z1)); G2 =...

4 years ago | 0

Answered
Finding the value of the below curve
Using findpeaks — z1 = [0.00008 0.009]'; a11 = -2:0.002:2; k1 = atan(((0.02 + a11)./z1)) + atan((0.03 - a11)./z1); [pk1,loc...

4 years ago | 0

Answered
Solve equation by fzeros
It is straightforward to find all the roots. One approach — N = 6; x = linspace(-N, N); y = x-4*sin(x); zxi = find(dif...

4 years ago | 1

Answered
Genetic Algorithm Plot fval vs. generation
Use: options = optimoptions('ga','PlotFcn', @gaplotbestf); [gax,fval,termination,info]=ga(@three_var,3,[],[],[],[],lb,ub,[],[...

4 years ago | 0

| accepted

Answered
I am trying to use the rectangular pulse function, but I am not sure how to use it correctly to solve a Fourier problem.
It needs to have the beginning and end defined, and an arbitrary argument for the independent variable (here ‘t’) — syms omega...

4 years ago | 0

| accepted

Answered
Discret low-pass-filter for velocity data
That the data are ‘really noisy’ unfortunately says nothing about the nature of the noise. If the noise is band-limited (determ...

4 years ago | 1

| accepted

Answered
What is the output type of coeffs(y)?
Use whos (or related functions) to find out — syms x y=16*x^2+19*x+11; a = flip(coeffs(y)) b = sym2poly(y) whos a who...

4 years ago | 1

| accepted

Answered
Fit 2 parameters with lsqcurvefit including an integral term
Using your posted revised code (lightly edited) — xdata = [10.30, 29.88, 59.64, 99.58, 149.66, 209.96, 280.44, 361.03, 451.87,...

4 years ago | 1

| accepted

Answered
How to fix jump signal?
One approach — Fs = 256; t = linspace(0, Fs*10-1, Fs)/Fs; s1 = randn(size(t))*0.5; ...

4 years ago | 2

| accepted

Answered
What does this error mean: "Assigning to 3 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment." How to remove?
There was a minor problem with indexing into the ‘bcv’ handle. Try something like this — times = [5,20,40,60,120]; ravgdm ...

4 years ago | 2

| accepted

Answered
How to generate random broadband vibration signal for certain frequency range ?
The usual approach is to generate a random signal (using either rand or randn) and then filter it — Fs = 500; ...

4 years ago | 0

| accepted

Answered
I cannot understand how to change the value of i in a 'text' code
Use sprintf — for i=1:num_nodes coord_matrix(i,1)= input(sprintf('What is the x-coordinate of node %d?',i)) end I can...

4 years ago | 1

| accepted

Answered
label is not at the center of axes
It is possible to force them to be exactly where you want them — t = linspace(0, 5, 500); x = cos(2*pi*t); y = sin(2*pi*t); ...

4 years ago | 0

| accepted

Answered
Extruding a 2D plot to 3D
Try this — k = -5:0.1:5; y = k.^2; figure surf([k;k], [y;y], [ones(size(k))*10; zeros(size(k))]) grid on colormap(turbo...

4 years ago | 0

| accepted

Answered
Basically I have the code for a 3d plot , now I need to plot Temperature (y axis) against length (x axis)
Try this — tspan=0:0.1:1; xspan=0:0.00002:0.0008; L=max(xspan); a2=4.46*10^-7; n=14; u=zeros(length(tspan),length(x...

4 years ago | 0

Answered
How can I multiply each row of 3 matrices individually?
The part of this involving and is ambiguous. It would help to know what and are, because it appears that is a vector, and...

4 years ago | 0

Answered
Display coordinates on the best location
The desirred result is not obvious. If I understand correctly what you want to do, there are two options: Use the xlim func...

4 years ago | 0

Answered
How to find the value of x when y = 0 and label on the curve?
Using interp1 — x = 0:0.01:66.03; y=(3.7*(10*(x/66.03).^3-15*(x/66.03).^4+6*(x/66.03).^5)-1.86); x_at_y0 = interp1(y,x,0)...

4 years ago | 0

| accepted

Answered
find the angles of a triangle given double coordinates
One approach, based on code I wrote for a different Answer — a1=1.49895; a2=2.62186; b1=1.49747; b2=2.62186; c1=1.49747; ...

4 years ago | 0

| accepted

Answered
I want to change the color of the markers in scatter plot which are below the function line
d = 4; N = 1000; X = linspace(0,d,N); func = @(X) 2*X.*cos(X.^2).*exp(sin(X.^2)) + 14; limit = func(X); x = 4*rand(1,...

4 years ago | 0

| accepted

Answered
How does the step function work?
You forgot to actually use the Heaviside unit step function as an input! num = [-5.21]; den = [1 6 73]; G = tf(num, den) ...

4 years ago | 2

| accepted

Answered
How do I filter my accelerometer data so that when I integrate it I have no drift?
The fft plot does not make sense. Before you do any signal processing (including the fft), first be certain that the signal i...

4 years ago | 2

Answered
How to add hours to the time data of one day
The hours would have to be added as a column vector, and the other variables repeated so that all the rows were the same. It is...

4 years ago | 0

| accepted

Answered
Predict function from system identification toolbox, which algorithm is it?
The documentation does not go into any details as to how it works. Aniother function that could be worth considreing is the f...

4 years ago | 1

| accepted

Load more