Answered
Help with unstack function on matlab
I am not certain what you want. This is the best I can do with the provided data — T1 = readtable('https://www.mathworks.co...

4 years ago | 0

| accepted

Answered
I want to draw graph between "P" and "x" but it is throwing the following error.
The ‘x’ value is being used as an integration llimit, and integration limits must be scalars. One solution is to devine the ‘...

4 years ago | 0

| accepted

Answered
My code is keep plotting the wrong data
Perhaps — TEST = randn(150,9); M = TEST(:,[8 9 2]); x = M(:,1); y = M(:,2); z = M(:,3); L = size(M,1); xv = linspace(mi...

4 years ago | 1

| accepted

Answered
Fitting a straight line to a specific region of the graph
I suspect the problem is in using‘T’ as a subscript, since subscript values must be integers greater than 0 or logical values. ...

4 years ago | 1

| accepted

Answered
Fft graphs exhibit symmetry on the x axis, but not around 0
It appears that you are plotting part of a two-sided Fourier transform. I generally use this approach to plot a one-sided Fou...

4 years ago | 0

Answered
Finding all possible zeros for a function with 2 independent variables.
The contour and fimplicit funcitons are likely best for this. For contour, create a matrix for ‘v’ and ‘n’ using either ndgri...

4 years ago | 0

| accepted

Answered
i have a vector and i want to convert it in to single cell aray.
I am not certain what result you want. Two options — A = [12 33 44 55 66] B = num2cell(A) B = {A} .

4 years ago | 0

Answered
How can I solve the following error?
Somewhere you have a variable named ‘sum’ and this is throwing the error. The solution is to re-name the variable to somethin...

4 years ago | 1

Answered
Is it possible to create a surface plot from scattered points?
Another approach — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1055560/Datas_xymises.txt', ...

4 years ago | 0

| accepted

Answered
FFT giving undesired answer
‘For reference, the code below currently gives that the vertGridSpacing is 59.94 pixels, while the true vertGridSpacing should b...

4 years ago | 0

| accepted

Answered
how do i read just the header in a csv file and write them into a file
One approach — header='field1,field2,field3,field4,field5' headerstring = string(strsplit(header,',')).' .

4 years ago | 0

| accepted

Answered
extract data from one day from a timetable
Try something like this — LD = load('ask_matlab.mat'); TT1 = LD.ans; RT = TT1.Properties.RowTimes; VN = TT1.Properties.Vari...

4 years ago | 0

| accepted

Answered
Unrecognized function or variable 't'.
Just befor the ‘u’ assignment, insert these assignments: tmax = 10; % Maximum Time t...

4 years ago | 0

Answered
How to select a certain range in the middle of my data?
There are different ways to do this. One approach — ReadDataX = 0:0.5:10 ReadDataY = randi(9,size(ReadDataX)) Lv = ReadDa...

4 years ago | 1

| accepted

Answered
How to take data from multiple variables and store them in one variable?
I am not certain what you want, however one option would be a cell array — v1 = rand(3) v2 = 'This is Variable #2' v3 = exp(...

4 years ago | 0

| accepted

Answered
to build a table with XYZ values
In order to save them to a file, use the (:) operator or the reshape function to create column vectors from the matrices. Conca...

4 years ago | 0

Answered
Interpolating points in a 3D space with one line
Try something like this — rpm = rand(5,1); dosage = rand(5,1)*0.1; mass_of_leaves = rand(5,1); B = [dosage mass_of_leaves...

4 years ago | 0

| accepted

Answered
How do I plot a curve in MATLAB and see its characteristics response like overshoot, settling time, etc using Voltage vs time graph from excel.
Use readtable or readmatrix to import the data, then use the System Identification Toolbox functions, specifically iddata, ssest...

4 years ago | 0

Answered
How to apply moving harmonic average on an array?
If you want to calculate it as described in the harmmean More About section, perhaps something like this would work — movhm = ...

4 years ago | 1

Answered
Im trying to plot two functions over a range
There are several missing operators (that I assume should be multiplication operators), and all the applidable operators should ...

4 years ago | 1

| accepted

Answered
Find the width of a peak
Try something like this — T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1053640/j1%20a30.csv'...

4 years ago | 1

| accepted

Answered
Plot an equation (sigma operator)
Try soemthing like this — n=3; kv=0:floor(n/2); xv=-2:0.1:2; H = zeros(size(xv)); Hv = zeros(size(xv)); for k2 = 1:numel...

4 years ago | 0

| accepted

Answered
Solve the system of three equations and three unknowns
Solve the system symbolically, then plug in the various values for , , and to get values for , , and — syms A B C D E x y z ...

4 years ago | 0

Answered
Wrong Legend Sign Marker
I am not able to run the code so I cannot test this, however one approach could be: legend([a1(1), a3(1) a4(1)], 'Fiducial Mar...

4 years ago | 1

| accepted

Answered
Readtable() Skipps last rows of csv
If you are using the unique function before writing the output file, it could be deleting several entries. Also, the correct ap...

4 years ago | 0

| accepted

Answered
Why 'NaT' (class: datetime) does not work with find function?
Use the isnat function to test for it. .

4 years ago | 1

| accepted

Answered
My code won't run, error message :Unrecognized function or variable 'ss'. Error in Q4_109 (line 19) Sys=ss(A,B,C,D);
If you are getting an error that MATLAB cannot find the ss function, then you need to license and install the Control System Too...

4 years ago | 1

Answered
Very basic question about fir1 command
Probably something like this — t=0:1/500:0.3; n=cos(2*pi*10*t) + sin(2*pi*50*t); Fs = 500; Fn = Fs/2; b = fir1(32, 25/Fn);...

4 years ago | 0

| accepted

Answered
Can someone please help me plot a Voigt function?
The Voigt profile appears to be slightly challenging to code. The File Exchange has a number of entries for Voigt.

4 years ago | 0

Answered
Plot legend in a bar graph
hFig = figure(1); Month = {'April'; 'May'; 'June'; 'July'; 'August'; 'September'; 'October'; 'November'; 'December';'January'...

4 years ago | 1

| accepted

Load more