Answered
Save number of iterations in a for loop
An easy solution is: n=10; for i=1:n tspan=[0 max(EXP.t)]; MAT=[SYSTEM.m_BW(i) SYSTEM.w_L(i) SYSTEM.w_K(i) SYSTEM...

5 years ago | 0

| accepted

Answered
How can i take multiple images from a folder (which is almost 800!) and perform specific operation?
You'd need to employ for or while loop with the following loop structure: M_FOLDER = '???\MATLAB'; % Directory where all image ...

5 years ago | 1

Answered
Plotting points on a graph every 15 minutes
You had better use timer class: https://www.mathworks.com/help/matlab/ref/timer-class.html

5 years ago | 0

Answered
how can i plot the amplitude spectrum of these signals
Fs = ... % Sampling freq t = ... % Time F = 0.25+cos(2*pi*50*t); L = length(F); N = 2^nextpow2(L); Y = f...

5 years ago | 0

Answered
When creating a table, how do I specify the dimensions of a particular variable?
It is better to create a zero matrix and then assign a table variable, e.g.: Nrows=10; Ncols=8; A = zeros(10, 8); my_table ...

5 years ago | 0

Answered
how to calculate mean square error ?
You have already computed in the last line of the code. Maybe you meant root mean square error. If so, MSE = mean(fit_err.^2); ...

5 years ago | 0

Answered
Creating a simulink model to analyse the harmonics on the substation
You can model your exercise simulation model in combination MATLAB+Simulink. Simulink modelling is strainghtfoward. If you don't...

5 years ago | 1

Solved


ABBREVIATION
Abbreviate the given string. Consider Only Capital Letters. EXAMPLE If input is 'Abbreviation of The Given String' then ou...

5 years ago

Answered
How to display subplot with multiple image with its own x and y axes ?
subplot(2,2,1); imshow(Newforegnd); % Use this command axis on ...

5 years ago | 1

Answered
Trial and error help needed
You can start by studying how to employ some MATLAB's built in fcns, such as, hexToBinaryVector()

5 years ago | 0

Answered
How to plot the fft if we are having the data ?
Hi, Here is a correct and complete code for fft calc and plot with your data given in .xls data file: clearvars; clf; D=rea...

5 years ago | 0

Answered
Lowest value of n for a fibonacci series
f(1)=a; f(2)=b; k=2; while f(k)<1e5 f(k+1)=f(k-1)+f(k); k=k+1; end fprintf('The final value is %d \n', f(end))

5 years ago | 0

Solved


How many digits are there?
Input(s) - any string Output(n) - number of digits within string s

5 years ago

Solved


Convert Two Character String into a Binary Vector
Given a string "XOXXO" convert it into a binary vector. [1 0 1 1 0] Paul Berglund implemented an optimal method in <http://ww...

5 years ago

Solved


MATLAB Basics: Complex Numbers
For a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].

5 years ago

Answered
Errors I have never encountered:Error using randg
Maybe, you would need to refresh up your matlab with: clear all and restart it.

5 years ago | 0

Answered
How can I generate audio chirp signal ?
Just using audiowrite(), e.g.: t = linspace(0, 4.8, 4.8E+4); f0 = 200; f1 = 10000; Fs = round(1/mean(diff(t))); % Has to...

5 years ago | 0

Solved


Find out characteristics equation of given matrix.
Find out characteristics equation of given matrix. A=[0 2; 1 8] then char. eq is s^2-8*s-2=0 and answer should be [1 -8 -2]

5 years ago

Answered
Remove steps in signal
Use: detrend() Remove: mean()

5 years ago | 0

| accepted

Answered
Cell array and matrix operation
for ii=1:4 for jj=1:4 ANS{ii,jj} = (A*C{ii,jj}-B*C{ii,jj})/((C{ii,jj}.^2).*C{ii,jj}.*(1+(B./C{ii,jj}).^2)).^(1.5); ...

5 years ago | 1

| accepted

Answered
Unable to concatenate the table variables
FName='myout.csv'; D= readtable(FName); DATA= [D.Var1, D.Var2];

5 years ago | 0

Answered
why Discrete Time Integrator block is not working in For iterator subsystem?
See attached a simple example employing a [discrete integrator] works ok with [for loop] subsystem.

5 years ago | 0

Answered
How is the transfer function determined for a PID controller
T = tf(Kp, [1 10 20+Kp]);

5 years ago | 0

| accepted

Solved


List the nth prime quartet prefix
Prime numbers larger than 5 can end only in 1, 3, 7, or 9, but of course not all numbers ending in these four digits are prime. ...

5 years ago

Solved


Roman numbers: how old is that building?
The front of old buildings sometimes show the year when they were built in roman numbers. These number are rather confusing and ...

5 years ago

Solved


Minimum jumps to reach end of the array
Given an array of integers where each element represents the max number of steps that can be made forward from that element. Ste...

5 years ago

Answered
Adding Legend to Bar Graph
Why you keep using this useless (removed) part of your code: for i = 1:length(StepsS2.Time) switch StepsS2.ActivityType(i) ca...

5 years ago | 0

Solved


Write script that gives matrix like the following example:)
if x=2; y=[2 1; 1 1] if x=4; y=[4 3 2 1 3 3 2 1 0 2 2 1 0 0 1 1] if x=5; y=[5 4 3 2 ...

5 years ago

Solved


Draw matrix 'Swiss flag'( Euro 2020)
Draw a x-by-x matrix 'Swiss flag' using '1' and 0.(x is odd and bigger than 4) Example x=5 ans = [1 1 1 1 ...

5 years ago

Load more