Answered
Simulink "MATLAB Function" block and extremum value
Note that there are a couple of important points here. (1) v input argument values have to be given/known to perform the calcula...

3 years ago | 0

Answered
Using vertcat to convert cellarray consisting of mutiple columns into an array of multiple columns
Here is how it can be attained: C1 = {randi(3, 3)}; C2 = {ones(3)}; C3 = {zeros(3)}; C4 = {randi(3, 3)}; C5 = {ones(3)}; ...

3 years ago | 0

Answered
Global error and local error of euler method
Yes, error increase if h step size increases. See this simple example: dy = y(t) with y(0) = 3; y(n+1) =y(n)+h*f(t(n), y(n)); ...

3 years ago | 0

Answered
vertical concatenate strings in msgbox
Here is the corrected code: v = VideoReader(filename); % Create Videoreader object %Get i...

3 years ago | 1

Answered
Automatically sorting years and quarters in a serial number
One of the easy solutions is to cretae a table array with variable names: Year (numerical) and Quarter (categorical array), e.g....

3 years ago | 0

Answered
Why won't my graph plot properly in the live script?
Your shown screenshot shows that you are viewing it in MLX- editor. If you hover your mouse over your plotted figure and click o...

3 years ago | 0

Answered
How to remove rows in a cell array?
Here is how you can do it: load('stations1.mat'); [Rs, Cs] = find(cellfun(@isempty, stations1)); stations1(Rs,:)=[];

3 years ago | 1

| accepted

Answered
How to code equation
Put both functions in plot() command or use hold on: m = 10e-3; a = 0.05; c = 0.1; x1 = @(t)(m/a)*exp(-(c/a)*t); x2 = @(t)...

3 years ago | 0

Answered
index error,exceeding array dimensions.
Here is the corrected code: Vet = randi([-9,9], 1, 7); dim = numel(Vet)+1; V = ordina(Vet,dim) function Vet_ord = ordina(Vet...

3 years ago | 0

Answered
Plotting as intregral the acceleration of a thing
This is how you can solve this exercise: N=100; T=11; dt=T/N; t=0:dt:T; F = [0 2 2 0 0 -2 -2 0]; % Accel...

3 years ago | 0

| accepted

Answered
Matlab Simulink Arduino package
You would need MATLAB Support Package for Arduino Hardware - see Arduino Support from MATLAB - Hardware Support - MATLAB & Simul...

3 years ago | 0

Answered
How to code equation
A couple of small errors have been corrected: m = 10e-3; a = 0.05; c = 0.1; x = @(t)(m/a)*exp(-(c/a)*t); t = linspace(0,1...

3 years ago | 0

| accepted

Answered
Calculate Wavelength from velocity FFT
the Matlab fcn fft() computes the complex valued discrete Fourier Transform values. Thus, there is an error in your code. To ob...

3 years ago | 0

Answered
how to solve this error?
Here is completely fixed code. There were several errors with inconsistent variable names, setting and solving symbolic equation...

3 years ago | 0

Answered
How to pull values from a variable to set as a new variable/column
If understood your question correctly, to read this data file and sort out its content, readtable() would be a good strating poi...

3 years ago | 0

Answered
Why is the FOR loop in my program producing empty matrices?
Here is a bit edited and revised version of your code: Ne=8; Ni=2; re=rand(Ne,1); ri=rand(Ni,1); a=[0.02*ones(Ne,1); 0.02+0.0...

3 years ago | 0

Answered
Plot a sinusoidal signal from an x(t) equation
You need to plot this exercise this way: Ts = 1/8; %seconds t = 0:Ts:1; x = @(t) cos(2*pi*t-(pi/2)); XX=x(t); plot(t, XX, ...

3 years ago | 0

| accepted

Answered
How do I let the user enter an equation that is then able to be used in abs() calcualtions
Use this small change by specifying the input argument (x) in your code: x = 0:0.001:1; fprintf(1,'For example: cos(x)\n'); ...

3 years ago | 1

| accepted

Answered
Keep Simulink Data Inspector plot settings between simulation runs
You should try to run this: Simulink.sdi.clearPreferences to get back to the default settings of Simulink. See help doc here...

3 years ago | 0

Answered
Finding the maximum value in a single
Here is how you can get max values from 1-by-n-by-3 array from each channel exaplined with a simple example: PP(:,:,1) = round(...

3 years ago | 0

Answered
How to change the colorbar limits in Matlab?
clim does the job, e.g.: surf(peaks) clim([1.2 2.6]) colorbar

3 years ago | 0

Answered
Change values in vectors
V=[1,2,3,4,5,6] IDX = find(V>3); V(IDX)=2 %% ALT. Way: V=[1,2,3,4,5,6] V(V>3)=2

3 years ago | 0

Answered
how does zoomplot work?
1st of all zoomPlot() is a 3rd party function and is not part of MATLAB 2022b package or its toolboxes. Therefore, to see what c...

3 years ago | 0

| accepted

Answered
Limit of Decreasing Plot Size in MATLAB
You should try these options with 'units', 'pixels': set(gcf,'units', 'pixels','position', [700, 700, 50, 50])

3 years ago | 0

Answered
How to Extract X,Y,Z vectors from grid data?
If you data as given n-by-5, then you can just use surf(z), e.g.: data = rand(5,50); surf(data)

3 years ago | 0

Answered
%() Error: Illegal use of reserved keyword "end".
Here is the corrected part of your code: ... for ID_realz = 1:N rng('shuffle'); Mult_noise = (sigma*randn(size(I...

3 years ago | 0

| accepted

Answered
I get an error that does not match the number of rows and columns in the program.
There were over dozens of size related errors, figure handle and uncommented comments in your code that are fixed. The main func...

3 years ago | 1

| accepted

Answered
Interpolating numerical function of many variables
You should consider here some sort of unit compatibe value for U, S, D, V. In other words, 100% (and 80%, 60%, 40%, 20%) open U ...

3 years ago | 0

Answered
My code does not work
Note also that there is one more undefined input vars in your function call. v_e is undefined, v_idex is computed from the given...

3 years ago | 0

Answered
for loop to read different files
There are a few different ways that can do this exercise. Here is one of them: clearvars FILE = fullfile('C:\Users\...', '*.tx...

3 years ago | 1

Load more