Answered
Algorithm for a Loop in a Table
In your case, you'd need to use hand entry. However, if your pattern is repeating then, you can employ replem() and get these. ...

4 years ago | 0

| accepted

Answered
how to sampling the signal in order to match the two signal?
% They perfectly match as you can see the plot below. MC = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_...

4 years ago | 0

Answered
Sampling data at x_n=cos(n*pi/N) for fft derivative
I'd see here to use logical indexing for sampling. E.g.: N=10; y=rand(1,N)*10; x_n = cos((0:N)'*pi/N); Y_Sampled=y(x_n>=0)...

4 years ago | 1

Answered
Sum using for loop
In your code, there is an err inside a loop, and here is the correction; ... % E.g. X and Y can be a row or column vector of a...

4 years ago | 0

Answered
how do I play sound during drawing a live plot
You should include an audio file along with the videoFrame in your code, e.g.: writerObj = videoFWriter('neuronfire.avi','my_mu...

4 years ago | 0

Answered
Reducing the distance among subplot figures?
Set up axis position of subplots, e,g: x=0:1:360; y=-180:1:180; G = cos(x)+sin(y(:)); HA(1) = subplot(221); surf(G) HA...

4 years ago | 0

Answered
how can i fix Error using sym/min (line 101)
It looks like one of your intoduced symbolic variables is defined to be class type of "char". Check all symbolic variables usin...

4 years ago | 0

Answered
Convert time domain to frequency domain quarter car suspension model
Your question is more of a mechanical engineering (vibrations and control domain) related type. Note that to switch or obtain Fr...

4 years ago | 0

| accepted

Answered
Trying to vectorize this for loop of creating matrices within matricees
If undesrtood your question correctly, you are trying to select particular regions of images and save them. If so, this can be...

4 years ago | 0

Answered
Pre-allocate memory to zeros or NaN?
Of course, you can do memory allocation with nan() as well alike zeros(), e.g.: k=10; m=15; M = nan(k, m); ...

4 years ago | 0

Answered
How to create an array with user inputs?
You can consider using input() prompt. See this doc with examples: https://www.mathworks.com/help/matlab/ref/input.html?s_tid=sr...

4 years ago | 0

Solved


Split a given string from the first instance of a given character
A simple operation to split a given string into two substrings at the point where the desired character is first found. e.g. ...

4 years ago

Solved


most frequent character
Obtain the most frequent character. For example, s='balaram'; output='a'; If there is a tie between letters, return t...

4 years ago

Solved


Concatenate strings
concatenate a variable number of input strings to produce one outputstring

4 years ago

Solved


NO _________ ALLOWED....
So you're given a sentence where if there is a particular word in the sentence then the output is 1, if it is not there then the...

4 years ago

Answered
2D ODE with constant? how to solve
Most parts of your code is ok, but within the loop, you have overlooked sth and thus, you final solutions are not quite accurate...

4 years ago | 0

| accepted

Answered
Extract row from time series table based on independent variable
% Use Logical Indexing: IDX = (channel0.data>133.01 & channel0.data<133.03); DATA_OK=DATA(IDX,:); ...

4 years ago | 0

Answered
How to loop through variable names and to save them on one file?
It looks that will require another loop outside the main loop, something like this one, e.g.: for i = 1:height(unique(data_time...

4 years ago | 0

Answered
Get peak values from a Surface mesh figure?
You can use MATLAB's built in findpeaks() fcn to clocate local maxima of your data - see the doc: https://www.mathworks.com/help...

4 years ago | 0

Answered
How to locate the index of cell array that has highest element value?
You can do it with sort() and by manipulating your main cell array a little bit. See this plain example: A{1,1}=1; A{2,1}=5; A...

4 years ago | 0

Answered
2D ODE with constant? how to solve
Use odex (ode23, ode45, ode113, etc.) solvers. See this doc how to employ them in your exercise: https://www.mathworks.com/help/...

4 years ago | 0

Answered
Multiple piecewise linear fitting equation extraction
Yes, it is viable. There are a few discussions in MATLAB community how to do such regressions. Here is one of them: https://www....

4 years ago | 0

Answered
Can I monitor the progress of a fitting?
If you are going to employ nonlinear fit with lsqcurvefit or fminunc, you can obtain some data from each iteration, see the full...

4 years ago | 0

Answered
Create arrays of observations
Here is one of the viable solutions with dynamically naming variables and attaining their values from the workspace. a = []; f...

4 years ago | 0

| accepted

Answered
Smooth a curve or increasing the resolution?
You may consider using a moving average filter smoothdata() with sgolay, for instance.

4 years ago | 0

Answered
Build a vector of file names with formatting and leading zeros
You can try using strcat() that works quite efficiently, e.g.: A = 'My_file_'; B='_'; firstInteger1=10; secondInteger1=20; Fi...

4 years ago | 0

Answered
ODE Undamped Spring Model is losing energy over time
A very nice question and observation! This is due to default error tolerances of the solver (ode45). By tightinging the relati...

4 years ago | 1

| accepted

Answered
Tips for organizing variables in the workspace? Is there an option like "exlude capitalized variables" like python/spyder?
The answer is "No". See this discussion: https://www.mathworks.com/matlabcentral/answers/181465-matlab-2014-change-workspace-sor...

4 years ago | 1

Answered
how to convert table to matrix?
Another alternative to convert table to matrix is to use a syntax: M=T.Var, e.g. T = table(magic(5)) M=T.Var1

4 years ago | 1

Answered
How can I plot the SNR graph?
I have looked through your code that is written according to your provided formulations. That means that your provided formulati...

4 years ago | 0

| accepted

Load more