Respondida
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...

más de 3 años hace | 0

Respondida
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)}; ...

más de 3 años hace | 0

Respondida
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)); ...

más de 3 años hace | 0

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

más de 3 años hace | 1

Respondida
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....

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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,:)=[];

más de 3 años hace | 1

| aceptada

Respondida
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)...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

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

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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, ...

más de 3 años hace | 0

| aceptada

Respondida
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'); ...

más de 3 años hace | 1

| aceptada

Respondida
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...

más de 3 años hace | 0

Respondida
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(...

más de 3 años hace | 0

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

más de 3 años hace | 0

Respondida
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

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

Respondida
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)

más de 3 años hace | 0

Respondida
%() 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...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 1

| aceptada

Respondida
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 ...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 1

Cargar más