Answered
unalbe to convert expression into double array
You need numeric single- or double-precision values for the ss2tf function. See: Input Arguments.

7 years ago | 0

| accepted

Answered
I have a code with several plots. How do I know from wich part of the code an specific plot comes from? (Matlab)
The only way I can think of is to plot them with distinctive line styles or markers (or some combination of these). See the plo...

7 years ago | 0

Answered
how can I do z tranform of this signal??
Consider the separate terms to understand the result: syms n c = -(0.5)^n*(heaviside(-n-1)) c1 = -(0.5)^n C1 = ztrans(c1) ...

7 years ago | 0

Answered
Adding row 2 and row 3 and multiplying it by 3
The semicolons make all the difference. I’m not at all certain what you want to do. Try this: A = [1 1 1 1 1; 1 1 1 1 1 ; ...

7 years ago | 0

Answered
fitting data into a quadratic curve
To force ‘b’ and ‘c’ to be zero: B = volume_flow_rate1(:).^2 \ influence(:) % Estimate Regression...

7 years ago | 1

| accepted

Answered
Area fill between minimum and maximum axis limit
You need to create a closed area for patch, that proceeds clockwise (or anticlockwise). The Code — figure patch([data_1; f...

7 years ago | 0

| accepted

Answered
Negative Value when using Trapz
The problem is easiest to see with: dx = diff(x) All the ‘dx’ results are negative because ‘x’ is goinmg from highest-to-lowe...

7 years ago | 3

| accepted

Answered
Could anyone help me with this integral?
The error message actually told you exactly what to do: To perform elementwise matrix powers, use '.^'. You need to use eleme...

7 years ago | 0

| accepted

Answered
Integration of angular velocity from IMU measurements
The pitch angle has a non-zero offset (so it is consistently greater than zero). The integration is integrating this constant a...

7 years ago | 0

| accepted

Answered
Adding Matrices of Different Sizes
I would creat all the vectors initially as zeros(1,24), then fill in the elements corresponding to the hours of occupation in QF...

7 years ago | 0

| accepted

Answered
Dimensions of arrays being concatenated are not consistent.
If they all have one row and you want to concatenate them, the only certain way is to use the horzcat function. If you want t...

7 years ago | 0

Answered
How to find the nth is the higher than and closest to 0.3
One approach: A=[5 56 6.1 0.29 0.32 15 ]; Av = A(A > 0.3); [~,idx] = min(abs(Av-0.3)); Out = Av(idx) Idx = find(A == Out) ...

7 years ago | 1

| accepted

Answered
'too many input arguments' error in Genetic Algorithm optimization toolbox
The ‘objective_function’ function does not take any input arguments, and it needs at least to take the vector of parameters you ...

7 years ago | 1

| accepted

Answered
(ODE45) Unable to perform assignment because the left and right sides have a different number of elements
The code you posted runs for me with out error in R2019b. The one change I made is to add an end statement to the function: ...

7 years ago | 0

Answered
How to do integration using Matlab
See the integral function documentation.

7 years ago | 0

Answered
Plot symbols the size of error
I am not certain what you want as a result. The scatter function is an option: figure scatter(x, y, err_x*100) grid If y...

7 years ago | 0

| accepted

Answered
How to fit multiple curves to one curve?
See: Area under each peak for an example of how to detect the Gaussians (and, if you want to, find thier areas).

7 years ago | 0

| accepted

Answered
how to change the precision of symbolic variables.
Use the vpa function: syms s p = s^3*246655351680430349161861489360895748665691918000757954295365632i - s^2*(362122551578204...

7 years ago | 0

Answered
Why my frequency domain graph looks so weird?
You are plotting only the real part of a two-sided Fourier transform. Try this: fs=1000;% this will define the the resoluti...

7 years ago | 0

Answered
How can I refine a portion of my mesh?
The arguments to ndgrid (or meshgrid) do not need to be uniform, they can be anything that makes sense to those functions. Ex...

7 years ago | 1

| accepted

Answered
Area Mach Number Relation
The easiest way is to just enclose the essence of your calculations in a loop: % Solve for Msub and Msup using this area ratio...

7 years ago | 1

| accepted

Answered
Display values as labels at the tips of serie of bars.
How do I display a value on bar?

7 years ago | 0

| accepted

Answered
Can I use lsqcurvefit for a function of multiple variables?
Your objective function ‘klaCorr’ needs to address the appropriate columns of ‘sv’: klaCorr = @(coeff,sv) coeff(1) + (sv(:,1)....

7 years ago | 0

| accepted

Answered
Plot function with changing variables
The plot function plots lines between two points. You appear to be plotting points, so you need to plot markers. Try this: ...

7 years ago | 1

| accepted

Answered
How to plot z (data) on x-y (grid) from a structure?
I took a few liberties with your code since I do not have the Mapping Toolbox. Try this: TotalData = load('Etransp_5steps.m...

7 years ago | 1

| accepted

Answered
legend imformation is incorrect
You must be plotting something else that is not in the code you posted or the data you attached. This code: D1 = load('Uppe...

7 years ago | 0

| accepted

Answered
Problem with fprintf command (matrix)
You need to provide separate format descriptors for each value you want to print on the same call to fprintf. Try this: fpr...

7 years ago | 1

| accepted

Answered
How can I fit data to a sine curve?
See: Curve fitting to a sinusoidal function. It just uses core MATLAB functions. No toolboxes needed at all.

7 years ago | 0

Answered
How to take value from function and put it into disp script?
Use: sprintf( ' The ball hits the ground at a distance of %d meters ',X) or: fprintf( ' The ball hits the ground at a dista...

7 years ago | 0

| accepted

Answered
FFT of vibration data, please help
Try this: D = xlsread('TEK0000.csv'); t = D(:,3); s = D(:,4); figure plot(t, s) grid xlabel('Time (s)') ylabel('V') ...

7 years ago | 0

Load more