Answered
Remove 'Matrix dimensions must agree'
The <https://www.mathworks.com/help/matlab/ref/bsxfun.html *|bsxfun|*> (link) function may be able to help you.

9 years ago | 0

Answered
Problem with generating a dual tone signal.
To get you started: Fs = 1.6E+4; % Sampling Frequency Ts = 1/Fs; ...

9 years ago | 0

Answered
This is code for a solution of a piece wise differential equation. I keep getting this error message: In an assignment A(:) = B, the number of elements in A and B must be the same.
Try this: t = 0:50; for k=1: length(t) if (t(k)<5); y(k)=((.5)*(exp((t(k)-5)/2)).*sin(((3*t(k))-5)/4)...

9 years ago | 0

Answered
Intersection of line and curve from thier points
Try this: x_line = [7020 0]; y_line = [0 250000]; x_curve = [5620 4850 4290 3600]; y_curve = [0 100000 200000...

9 years ago | 6

| accepted

Answered
How would i put complex roots on matlab for the question z^3 = 4 + i,
Try this: r = roots([1 0 0 (4+1i)])

9 years ago | 1

| accepted

Answered
Extracting confidence interval data from fitdist()
Use the *|paramci|* function: pd_ci = paramci(pd)

9 years ago | 2

| accepted

Answered
Acessing fields of a structure
I would use the *|strcmp|* function for the name comparison: users.username = {'Name_1', 'Name_2'}; % Create ...

9 years ago | 0

Answered
How can I Plot spectrogramm with Excel File
From your description, it seems that you have already created the spectrogram information. The MATLAB *|spectrogram|* funct...

9 years ago | 0

| accepted

Answered
How can i 3d plot z=x*y
Try this: z = x .* y; You need to do ‘element-wise’ multiplication, and adding the ‘dot operator’, changing |(*)| to |(...

9 years ago | 1

| accepted

Answered
i have a column array and i want to subtract each row by the first row and save.please help me in doing this
Try this: Array = randi(9, 5, 4); % Create Data Out = Array - Array(1,:); ...

9 years ago | 1

| accepted

Answered
Whats the influence of the initial conditions using the function "filter"?
You can use the <https://www.mathworks.com/help/signal/ref/filtic.html *|filtic|*> (link) function to calculate and set the init...

9 years ago | 0

Answered
how to get rid of error
I believe *|‘A’|* has dimension *|3|* by your description. Try this: A = sum(B,3); That will sum across the third ...

9 years ago | 0

| accepted

Answered
Find the derivative of a piecewise function and plot the result
The Symbolic Math Toolbox *|diff|* function will not differentiate it because of the discontinuities, either using my function o...

9 years ago | 2

| accepted

Answered
How would I output the 'ans' as 'TaxPayable' instead?
I get the impression that you are calling it as: TaxCalculator(AnnualSalary, Year) without an output variable. Calling...

9 years ago | 1

| accepted

Answered
How to find the maximum and minimum values of a piecewise function?
I’m not quite sure what you want to do. This will get you started: curv_arm = 3; curv_par = 5; s = @(theta, curv_ar...

9 years ago | 0

| accepted

Answered
If I multiply a sine wave with amplitude 1 with a cosine wave of amplitude 1, should the FFT have a magnitude of 0.25?
Your code (using element-wise operations) will produce a double-sideband suppressed-carrier signal. The energy of the complete ...

9 years ago | 0

Answered
How do I make the theta-axis or x-axis change color?
This is as close as I can get to doing what you want: x = linspace(0, 2*pi, 256); y = sin(x).^2; figure(1) pl...

9 years ago | 0

| accepted

Answered
Error when using residue function
If you have *|R2015a|* or later, use the <https://www.mathworks.com/help/symbolic/partfrac.html *|partfrac|*> (link) function. ...

9 years ago | 0

Answered
Why is my code getting stuck in interp1?
I cannot follow your code, and I don’t have the data. The *|interp1|* function is likely not the problem, unless it’s actually ...

9 years ago | 0

Answered
How to set the length of an imported series of data sets?
If you want all of them to have the same frequency resolution in the Fourier transform, zero-pad the shorter to the length of th...

9 years ago | 0

| accepted

Answered
Which tollbox for basic graphs and curve fits ?
If you want _all_ those capabilities, I would choose the <https://www.mathworks.com/help/stats/index.html *Statistics and Machin...

9 years ago | 0

Answered
Findpeaks in Frequency domain above a certain non-constant threshold
One option would be to subtract the threshold vector from every point on the amplitude curve, then use *|findpeaks|* on your res...

9 years ago | 2

Answered
( need help ) nested for loops to print the following pattern
You have to count _down_ from the present index of *|‘letter’|* in the loop to *|1|*. (It is difficult to illustrate it wit...

9 years ago | 0

Answered
How to create a smooth curve through data points?
There are various ways you can achieve this: Smooth noisy data using smoothdata https://www.mathworks.com/help/matlab/ref/smo...

9 years ago | 2

| accepted

Answered
How to generate n rows of random numbers such that each vector after the previous doesn't repeat a value in the same column position?
One approach: v1 = randperm(24); Out = [v1; circshift(v1, [0 randi(length(v1)-1)])]; It takes the first vector (firs...

9 years ago | 0

| accepted

Answered
Error using lsqcurvefit in non-linear data optimization
Your objective function does not use *|‘alfa’|*, so you are not doing any fitting of your data to *|‘cl’|*. Your objective func...

9 years ago | 1

Answered
How to rearrange rows in specific intervals
I use the Symbolic Math Toolbox to illustrate the approach and the desired result: syms x1 y1 z1 x2 y2 z2 x3 y3 z3 real ...

9 years ago | 0

| accepted

Answered
How do I solve for exp(A*t) using a fundamental matrix?
If I understand correctly what you want to do, use the <https://www.mathworks.com/help/matlab/ref/expm.html *|expm|*> (link) fun...

9 years ago | 0

Answered
How can i pull a corresponding y value for t=0.5, the matlab script below will out a list of values for y and t.
Easiest is to use the *|interp1|* function: y_t_05 = interp1(t, y, 0.5) y_t_05 = 1.093740231070597

9 years ago | 0

| accepted

Answered
How to design a filter for a .wav audio file to filter out high frequencies?
I would use the <https://www.mathworks.com/help/signal/ref/fir1.html *|fir1|*> (link) function. It uses a Hamming window by def...

9 years ago | 0

Load more