Answered
i am not able to get graph
Try this — H= 2.7; E= 1.05; V=1; g=5000000; p=5000000; f=50; dt=0.05; omega=0; base=g; G=g/base; M=(H*G)/(180*f); X...

4 years ago | 0

| accepted

Answered
Error bars not working on loglog plot
You are likely not doing anything wrong. The lower error bars are most likely negative, and values less than or equal to zero d...

4 years ago | 0

| accepted

Answered
Solving two equations simultaneously then plotting
For the first part, see if somoething like this would work — n = 1:10; m = 1:5; [N,M] = ndgrid(n,m); f = @(x,n,m) m.*x.^2 -...

4 years ago | 0

Answered
How to sum or complete surfaces obtained with the same meshgrid but presenting different data dimensions
There is not enough information to provide a specific response. If ‘A1’ and ‘A2’ and ‘B1’ and ‘B2’ have the same minimum and ...

4 years ago | 0

Answered
How to generate a legend with different values inside a loop
Try something like this — plot(x,y,'DisplayName', sprintf('E = %5d',E)) Change the sprintf format string to produce the desir...

4 years ago | 1

| accepted

Answered
Find all the peaks higher than this threshold and save the corresponding range in a variable.
Possibly: idxv = 1:numel(data(i).MaxPerRangeBin(1,:)); % Index Vector Lv = (data(i).MaxPerRangeBin(1,:...

4 years ago | 1

| accepted

Answered
I am getting the error "Array indices must be positive integers or logical values.". Anyone please help
The code calls them as functions, however addresses them as array elements, so create them as anonymous functions instead — ...

4 years ago | 0

Answered
how to apply if statement with equations
Using a ‘logical indexing’ approach instead of the if block — Cm2 = [80.105 81.868 97.935 116.429]; W2 = [82.564 83.693 98.0...

4 years ago | 0

| accepted

Answered
how to change this code to plot the frequency response of the desired interval?
That depends on what you want as the result. Two possibilities are fft and pspectrum with the 'spectrogram' option.

4 years ago | 0

| accepted

Answered
How to have this title graph?
Use sprintf instead — cycle = 42; minute = 24; title(sprintf('cycle = %.2f, minute = %.2f', cycle, minute)) Change the for...

4 years ago | 0

Answered
Taking the sum of exponentials
‘If it matters, . And is a vector of .’ I don’t see ‘t’ defined anywhere, so it depends on what relationship ‘t’ has to ‘x’ ...

4 years ago | 0

| accepted

Answered
If I have day month and Year in Xaxis, How can apply limit to the Xaxis?
If ‘x’ is a datetime array, the arguments to xlim must also be datetime values — x = datetime('now')+days(0:60); y = sin(2*pi...

4 years ago | 0

| accepted

Answered
Need to reduce the noise and get rid of high frequencies in my signal (low pass filter?)
If you have the Signal Processing Toolbox, the easiest way is to use the lowpass function. To get the most efficient filter, us...

4 years ago | 0

| accepted

Answered
Help using fsolve (theta beta mach)
The fsolve function is a root-finding algorithm, so the search must be for zeros of the function. The function needs to be expr...

4 years ago | 1

Answered
How to properly take the one-sided fft in MATLAB?
There appears to be missing information (specifically ‘G_t’ and ‘f_t’), so running the code is not possible. Otherwise: Fre...

4 years ago | 0

| accepted

Answered
symbolic matrix help converting
One problem is that ‘C’ is being used to designate the capacitor, and also the ‘ABCD’ (2,1) element. Designating the capacitor ...

4 years ago | 0

Answered
Create function for matlab code
See the documentation section on Function Basics.

4 years ago | 0

Answered
How to take the fft of a sum of exponentials?
I’m not certain what you want to do. The sum function produces a scalar result if ‘t’ and ‘A’ are the same size, so the Fourier...

4 years ago | 1

| accepted

Answered
scaling axes on plot
There are several options, the easiest of which is to use the surf function rather than imagesc to plot it. %set up variables...

4 years ago | 0

Answered
how import xls file in matlab
I would use readtable or readmatrix to import it, and scatter to plot it.

4 years ago | 1

Answered
Using Matlab ifft() to convert an exoprted frequency spectrum csv from other tool, how to get right amplitude ?
The signal has an extremely high level of broadband noise, and the recovered time domain signal reflects that. One option to ...

4 years ago | 0

Answered
Stresses around an edge dislocation equation/plot contour
See my Comment to a different question on exactly the same problem.

4 years ago | 0

| accepted

Answered
Removing spikes with standard deviation
Without the data, it is not possible to determine the reason the code does not work. See if the rmoutliers function (introduc...

4 years ago | 0

| accepted

Answered
Two strcmp conditions in one if statement
‘I don't get any errors when I run the code, I simply get blank doubles for each of the timepoints.’ That would indicate to m...

4 years ago | 0

| accepted

Answered
Why do I get an error when I try to use the solve function?
The quoted character array notationi may no longer be usable. Try this isntead — syms x y [x,y] = solve(x+2*y == 4, 2*x -...

4 years ago | 0

| accepted

Answered
I have an Excel file having sample data and magnitude, I want to convert the time domain to frequency domain using FFT, The file is attached
It is probably not giving the desired result because the fft is truncated to 1024. Ths signal is much longer than that, and the...

4 years ago | 1

Answered
Is it possible to do a search in a table for a value nearest to a number I want?
Your quesiton is a bit ambiguous, so I am not certain what result you want. Try this — array = [1 3; 2 4; ...

4 years ago | 0

Answered
Fractions in "fprintf"
Try using the rats function — x=0.25; y=0.75; strlen = 3; fprintf('This is the Optimal Solution: [%s, %s]\n', rats(x,strl...

4 years ago | 0

| accepted

Answered
Is there a way to create subscripts in the script editor?
The only way I am aware of to display subscripts is described in Matrix Indexing. If you intend something else, please be speci...

4 years ago | 0

| accepted

Answered
How to export a table including column names?
It might be better to write it as a text file instead, since a .csv file may not be appropriate. writetable(MyTable,'MyTable...

4 years ago | 2

Load more