Answered
An EEG dataset .txt , I want to transpose the rows and columns for all files.
I would still keep them as they are in the files, and transpose them after you read the files. EEG = readmatrix('S9 HC.txt') ...

3 years ago | 1

Answered
How to import range of text files into different matrices?
I do not know anything about the file contents, so the easiest way would be to save them to cell array elements. D = cell(50,...

3 years ago | 0

Answered
I have an error saying 'Operator '*' is not supported for operands of type 'function_handle'." and I do not know what to do.
Function handle calls need to be evaluated. You code came close, however the syntax did not allow them to actually be evaluate...

3 years ago | 0

| accepted

Answered
Arrays have incompatible sizes for this operation.
The problem is: v = logspace(6, 11, 1000); % Using logspace for a smoother frequency range since everything else has a length...

3 years ago | 1

| accepted

Answered
Poctave bars next to each other
I cannot replicate your results with my prototype signal. The current ‘BarLayout’ property in your plot is 'stacked'. You ne...

3 years ago | 0

| accepted

Answered
Smoothing 3D surface plot and its color gradient
Experiment with the daspect function — filename = 'Data.csv'; data = readmatrix(filename); x = data(:, 1); y = data(:, 2)...

3 years ago | 1

| accepted

Answered
Pre-processing Data (PRV Signals)
The Signal Processing Toolbox resample function is specifically intended for signal processing and incorporates anti-aliasing fi...

3 years ago | 1

Answered
Trying to do a Laplace transform on a discontinuous function
I initially wanted to see if piecewise would work. It didn’t. This is the result I get using heaviside to define the areas o...

3 years ago | 0

Answered
Plots multiple lines-of-best-fits instead of just one
The data are missing, so an exact solution is not currently possible. The additional lilne could be that you are plotting bot...

3 years ago | 0

Answered
Data analysis - How to recognize local peaks/different areas?
It would help to have the data. It is relatively straightforward to get the start and end times and then store the relevant d...

3 years ago | 2

| accepted

Answered
Why do i get an error saying "Unrecognized function or variable 'x'."
You have not defined ‘x’ specifically in your calling script prior to calling the function. Try something like this — x = ...

3 years ago | 0

Answered
Trouble importing data from folder
I’m not certain that I understand what you want to do. If you want the number from the file name, perhaps something like thi...

3 years ago | 0

Answered
Linear Algebra Error: Matrix is close to singular or badly scaled.
I am not certain what you want to do. Consider using the pinv function.

3 years ago | 0

| accepted

Answered
How to evaluate an equation with sin and cos at different values in radians.
Vectorise it (note the element-wise operations) — x = [0; pi/2; pi; 3*pi/2]; f = (-0.05-0.01*x)./((5*x+0.3).*cos(x)+(0.2*x.^2...

3 years ago | 1

| accepted

Answered
Problem using tf to perform a transfer function.
You need to have the Control System Toolbox licensed and installed. With that, the code works appropriately — numg=[6 0 1];...

3 years ago | 1

| accepted

Answered
How print the loop iteration value each time to show progress of loop during a run
I am not certain what you want to do, however when I have done something similar, I usually do something like this: k = 12345;...

3 years ago | 0

| accepted

Answered
How do I include legend entries only for an array and not for each line of data?
Create handles for each plot call, and then use the first elements of those handles as the first argument to legend — t = lins...

3 years ago | 1

| accepted

Answered
how to speed ...i need very fast code
Putting the ‘a’ conditional tests outside the loop (and still within the tic-toc block) sppeds it up a bit — LD = load('matlab...

3 years ago | 0

| accepted

Answered
pie chart creation with name (number) and corresponding percentage
One approach — number = [78;79;80;81;82;83;84;85;86;87;88]'; value = [4509;5239;6400;9074;11047;13147;15137;13909;6354;1152;1...

3 years ago | 0

| accepted

Answered
problem with cell array e unique
There are 9 empty cells in ‘RankList’ and they were causing the problem. Try this — LD = load('matlab_RankList.mat') RankL...

3 years ago | 0

| accepted

Answered
Convert string into date
No loop needed. Just use datetime — str = "145601" DT = datetime(str, 'InputFormat',"HHmmss", 'Format','HH:mm:ss') .

3 years ago | 0

| accepted

Answered
How do I make shaded error bar area instead of lines?
It would help to have your data. Perhaps something like this — x = logspace(-10, 5, 150).'; ...

3 years ago | 1

Answered
polynomial fit for a schottky diode and evaluation of its characteristics (ideality factor, barrier height and I0)
It is relatively straightforward to do a nonlinear parameter estimate of the required parameters in MATLAB. Try this — T1 =...

3 years ago | 1

| accepted

Answered
How to extend an array to a new dimension?
One option is the repmat function — a=rand(3, 4); b = zeros([size(a) 5]); for i=1:5 b(:, :, i) = a; end b ...

3 years ago | 1

| accepted

Answered
curve fitting of a nyquist plot
I doubt that there is any direct way to fit it, for example to a nyquist plot. You would have to estimate the system first. T...

3 years ago | 1

| accepted

Answered
Finding uncertainty of a slope
This is straightforward if you have the Statistics and Machine Learning Toolbox. Use regress to get the confidence intervals. ...

3 years ago | 0

Answered
Interpolate data between two specified contours
I am not certain what result you want. The easiest way is probably to use the contour function itself to interpolate. Examp...

3 years ago | 0

| accepted

Answered
how can I show all my output plots from a script at the same time
They probably all occupy the same relative position so they overlap. They are all there, with the later figures covering the e...

3 years ago | 0

Answered
Help IFFT can not restore to original signal after filtering
The fftfilt function can do this relatively efficiently, however since you want to do it manually, try this — %USING REAL SIG...

3 years ago | 0

| accepted

Answered
Error using interp3 "Error using griddedInterpolant. Grid arrays must have NDGRID structure"
The ndgrid function creates gridded data (in 2, 3, ..., n) dimehsions from its argument vectors. Considering the nature of yo...

3 years ago | 0

Load more