Answered
How to skip lines of Data in a middle of a text file
Try this: fidi = fopen('extractcdb.txt','rt'); k1 = 1; while ~feof(fidi) for k2 = 1:3 StepInfo{k1,k2} = fgetl(...

7 years ago | 0

| accepted

Answered
How can I get plot with smooth lines from this data?
If you do not have the Curve Fitting Toolbox, use the core MATLAB spline (link) function: a=[500,1000,1700,1300,1400,3900,3400...

7 years ago | 1

| accepted

Answered
Create confidence interval for linear regression line
I would use the fitlm (link) function to calculate the regression line, the the predict function to calculate the confidence int...

7 years ago | 2

| accepted

Answered
lottopick(m) Undefined function or variable 'john'.
You most likely need to enclose the name in single quotes: lottopick('john'),

7 years ago | 1

| accepted

Answered
Blank plot in matlab
The immediate problem is: plot(t,length(Z0)); since the length function will produce a scalar, and you can only plot a scalar...

7 years ago | 2

| accepted

Answered
how to get "fft" of sin wave?
The amplitude appears to be correct. You need to define the frequency axis to get the frequencies to be correct: final_point=...

7 years ago | 1

| accepted

Answered
How to make a .csv file with data values in .txt
If you want to read your file using readtable, you need to do some processing on it afterwards: T = readtable('data.txt','Read...

7 years ago | 0

| accepted

Answered
Condition for matlab if
I suspect that here: PP=Wscat((g(i)-50:g(i)),i) ; % Error Subscript indices must either be real positive integers or logicals...

7 years ago | 0

Answered
hourly mean - why do I get the following error
The problem may be that you’re running your code in the Command Window. When I run it in a script, it runs without error and ...

7 years ago | 0

Answered
can you write a vector function?
You pretty much wrote it yourself: x = @(u,v) [2-v.*sin(u/2).*sin(u); 2-v.*sin(u/2).*cos(u); v.*cos(u/2)]; See the documenta...

7 years ago | 0

| accepted

Answered
Issue solve function using complex numbers
I cannot figure out the reason solve is not solving for those values. I ended up with this: Rfcn = matlabFunction(Zeq) Rr(...

7 years ago | 0

| accepted

Answered
Marking a single point on a graph
This first finds the approximate indices for the zero-crossings, then interpolates to find the exact values: sigma_x = 8; sig...

7 years ago | 0

| accepted

Answered
Interpolation when y data is not strictly a function of x
I am not certain what you want to do. Your data appear to be hysteresis curves. It is straightforward to fit them, using my ...

7 years ago | 0

| accepted

Answered
Plot a curve with coordinates
Without knowing what your data are, this will plot the peak and valley values as a functions of the indices: figure plot(inde...

7 years ago | 0

Answered
How to represent a chaotic trajectory in MatLab?
I remember this system. I do not know what you intend by ‘chaotic trajectory’ here. If you want to plot the derivative of ‘k...

7 years ago | 0

| accepted

Answered
finding prominent maxima and minima of a column vector
Although findpeaks needs some help here, it can find all four: [D,S] = xlsread('ab1.xlsx'); [pks,plocs] = findpeaks([D(:,2)...

7 years ago | 1

| accepted

Answered
Changing color of graphs in MATLAB plot
With 7000+ curves, it is unlikely that you are going to be able to distinguish them regardless of the colormap you use. I wou...

7 years ago | 2

| accepted

Answered
How do you remove specific rows from a cell array?
One approach: C = {{'myPC\Documents\MATLAB\DataAnalysis\temp\6\Temp-20\TS1.csv' } {'myPC\Documents\MATLAB\DataAna...

7 years ago | 1

| accepted

Answered
How to represent the followind ODE system in MatLab?
Define ‘y’ as ‘x(1)’, ‘k’ as ‘x(2)’, and code it using those substitutions. (I coded it as a one-line anonymous function.) R...

7 years ago | 0

| accepted

Answered
plot quiver onto the base of a 3D plot
This seems to approximate what I believe you want: [x,y] = meshgrid(-80:80, -80:80); z = -(cosd(x).^2 + cosd(y).^2).^2; mesh...

7 years ago | 1

| accepted

Answered
How to add equation to function
Except for your ‘rocket’ function, most of that looks as though it should work. Leave out the subscript reference when you ar...

7 years ago | 1

Answered
How to make a matrix from a for loop
If you need to do it with the loop, this works: t = 0:2:100; for k = 1:numel(t) h(k) = rocket(t(k)); if h>=0 ...

7 years ago | 0

| accepted

Answered
plotting root of Polynomial Equation
You need to extract the double arrays from the cells in ‘EQ’: plot(p,real([EQ2{:}]),'-', p,imag([EQ2{:}]),'--') The cell2mat...

7 years ago | 0

| accepted

Answered
text scan question of amplitude and phase
Try this: c = {'-7.30313259052058e-002dB,-4.26354774426478e+000°'}; D = textscan(c{:}, '%fdB%f°', 'Delimiter',',') producing...

7 years ago | 0

Answered
How to Name Columns in a Table?
That looks like it should work. Try this: B = array2table(y) first, to be sure that all the columns in ‘y’ are actually be...

7 years ago | 1

| accepted

Answered
How to isolate one pulse from a periodic pulse train
One approach: t = linspace(0, 2.3, 500); % Time Vector pulses = -0.1...

7 years ago | 1

| accepted

Answered
Integration showing wrong answer
It is the correct result, although it may not be the one you were anticipaiting. Try this: syms x f(x) = sin(x)+2*cos(x) ...

7 years ago | 0

| accepted

Answered
How to determine the delay between two signals representing a single transition
There are several possibilities. One of course is the finddelay function and its friends. Others are findchangepts and ischa...

7 years ago | 0

| accepted

Answered
transfer p value to z value
Use the norminv function. If you do not have the Statistics and Machine Learning Toolbox, y9ou can use this anonymous functio...

7 years ago | 0

Load more