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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

Beantwortet
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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

Mehr laden