Answered

How to pad zero in string using sprintf

This should work on both char arrays as well as strings: a = { '1010' '111' '010' '10' '101...

How to pad zero in string using sprintf

This should work on both char arrays as well as strings: a = { '1010' '111' '010' '10' '101...

11 months ago | 2

Answered

How to implement a transfer function with variable coefficients?

The top part of your first diagram does not implement 1/(b+s). To confirm this, label the output of the top sum block as e. The...

How to implement a transfer function with variable coefficients?

The top part of your first diagram does not implement 1/(b+s). To confirm this, label the output of the top sum block as e. The...

11 months ago | 0

Answered

Scaled Step Response & Scaled Ramp Response of Transfer Function

Since responses of linear time-invariant (LTI) systems have the same shape for various amplitudes of a given input signal and ar...

Scaled Step Response & Scaled Ramp Response of Transfer Function

Since responses of linear time-invariant (LTI) systems have the same shape for various amplitudes of a given input signal and ar...

11 months ago | 1

| accepted

Answered

Different tick values on same axis

You can generate a ticks vector, which should be sorted and with unique elements: a=0; b=4; c=0; d=6; g=1; dxs=0.2; dxf...

Different tick values on same axis

You can generate a ticks vector, which should be sorted and with unique elements: a=0; b=4; c=0; d=6; g=1; dxs=0.2; dxf...

11 months ago | 1

Answered

How to change corrplot line and scatter dots properties?

Get the handle of the plot out and modify the desired properties: [~,~,h] = corrplot(rand(100,2)) h(1,2) h(1,2).Color = 'r'; ...

How to change corrplot line and scatter dots properties?

Get the handle of the plot out and modify the desired properties: [~,~,h] = corrplot(rand(100,2)) h(1,2) h(1,2).Color = 'r'; ...

11 months ago | 0

| accepted

Answered

auto correlation time in matlab

"Autocorrelation time" most likely means the lag (in days, in your case) where the autocorrelation sequence of your data it at a...

auto correlation time in matlab

"Autocorrelation time" most likely means the lag (in days, in your case) where the autocorrelation sequence of your data it at a...

12 months ago | 0

Answered

Trying to copy a column from a array into a tall array

Use tall() around the new data column: T = tall(rand(10,2)); t = rand(10,1); T(:,2) = tall(t);

Trying to copy a column from a array into a tall array

Use tall() around the new data column: T = tall(rand(10,2)); t = rand(10,1); T(:,2) = tall(t);

12 months ago | 0

Answered

Why am I obtaining incorrect values for Lipschitz 1/2 norms using the central difference method?

Unless I misunderstodd something, the derivative of is . Within the domain of [0,1], the maximum absolute value of this is...

Why am I obtaining incorrect values for Lipschitz 1/2 norms using the central difference method?

Unless I misunderstodd something, the derivative of is . Within the domain of [0,1], the maximum absolute value of this is...

12 months ago | 0

Answered

I am trying to do a scatter plot with 2 different Y axes with different scales using imported data on a graph.

% Dataset in a table T = table((1:100)', cumsum(rand(100,1)), cumsum(rand(100,1)), 'VariableNames', {'Time', 'Data1', 'Data2'})...

I am trying to do a scatter plot with 2 different Y axes with different scales using imported data on a graph.

% Dataset in a table T = table((1:100)', cumsum(rand(100,1)), cumsum(rand(100,1)), 'VariableNames', {'Time', 'Data1', 'Data2'})...

12 months ago | 1

Answered

How can I visualize by frequency for frequency range 0 - 70.87Hz? (EEG_1=3.8088)

load('VEPdata1.mat') subplot(211) plot(EEGdata) subplot(212) pspectrum(EEGdata, fs) ax = gca; ax.XLim = [0 0.072];

How can I visualize by frequency for frequency range 0 - 70.87Hz? (EEG_1=3.8088)

load('VEPdata1.mat') subplot(211) plot(EEGdata) subplot(212) pspectrum(EEGdata, fs) ax = gca; ax.XLim = [0 0.072];

12 months ago | 0

Answered

FSOLVE was working until enclosed in a function - difficult for me to interpret error

The variable pKb that you pass to the function is not initialized as global and assigned a value, so it is passed as [] to the f...

FSOLVE was working until enclosed in a function - difficult for me to interpret error

The variable pKb that you pass to the function is not initialized as global and assigned a value, so it is passed as [] to the f...

12 months ago | 1

| accepted

Answered

How to plot the phase margin?

The transfer function 20/(s+1) is your controller. As it is, it does not give you a 50-degree phase margin. You need to modify t...

How to plot the phase margin?

The transfer function 20/(s+1) is your controller. As it is, it does not give you a 50-degree phase margin. You need to modify t...

12 months ago | 0

| accepted

Answered

Hello, I would like to convert this mathematical equation into MATLAB code.

x = rand(100,1); N = numel(x); num = (sum(x)/N)^2; den = sum(abs(x.^2)) / N; s = num / den

Hello, I would like to convert this mathematical equation into MATLAB code.

x = rand(100,1); N = numel(x); num = (sum(x)/N)^2; den = sum(abs(x.^2)) / N; s = num / den

12 months ago | 1

Answered

Have title of plot change IF edit field has text, otherwise default

You are comparing the edit field object itself to 0, instead of the content of the edit field. Try if ~isempty(app.GraphTitleEd...

Have title of plot change IF edit field has text, otherwise default

You are comparing the edit field object itself to 0, instead of the content of the edit field. Try if ~isempty(app.GraphTitleEd...

12 months ago | 0

| accepted

Answered

How to make lines at given angles?

Looks like you are actually looking for 4 lines since angles of 0 and 360 would produce the same lines. But here is the for-loop...

How to make lines at given angles?

Looks like you are actually looking for 4 lines since angles of 0 and 360 would produce the same lines. But here is the for-loop...

12 months ago | 0

| accepted

Answered

How to count the total number of blink?

You can use a peak detection algorithm such as the islocalmax() command: https://www.mathworks.com/help/matlab/ref/islocalmax.ht...

How to count the total number of blink?

You can use a peak detection algorithm such as the islocalmax() command: https://www.mathworks.com/help/matlab/ref/islocalmax.ht...

12 months ago | 0

| accepted

Answered

Retrieve the coordinates of the point from the graph

If you want to do it manually on the plot by clicking with the mouse at or near the intersections, and get their coordinates, yo...

Retrieve the coordinates of the point from the graph

If you want to do it manually on the plot by clicking with the mouse at or near the intersections, and get their coordinates, yo...

12 months ago | 0

Answered

what's wrong with this code?

You don't need quotes inside the solve() command and use '==' for equality instead of '=': syms x syms y [x,y] = solve(x^3 - ...

what's wrong with this code?

You don't need quotes inside the solve() command and use '==' for equality instead of '=': syms x syms y [x,y] = solve(x^3 - ...

12 months ago | 0

| accepted

Answered

Shutdown at specific time

Call exit in StopFcn of the Timer object.

Shutdown at specific time

Call exit in StopFcn of the Timer object.

12 months ago | 0

| accepted

Answered

Merging tables with partly the same column names, but sometimes different dimensions

This seems like a table (outer) join problem. Take a look at: https://www.mathworks.com/help/matlab/ref/table.outerjoin.html Tl...

Merging tables with partly the same column names, but sometimes different dimensions

This seems like a table (outer) join problem. Take a look at: https://www.mathworks.com/help/matlab/ref/table.outerjoin.html Tl...

12 months ago | 0

| accepted

Answered

only one plot line is showing

There are two issues with your code. First, line([label_50 label_50], [round(N*0.5) round(N*0.5)]) is a point, not a line. So ...

only one plot line is showing

There are two issues with your code. First, line([label_50 label_50], [round(N*0.5) round(N*0.5)]) is a point, not a line. So ...

12 months ago | 0

| accepted

Answered

Why does the font size in my Axes change spontaneously?

axis.FontSize and axis.Label.FontSize are not independent properties. Setting axis.FontSize will not affect axis.Label.FontSize...

Why does the font size in my Axes change spontaneously?

axis.FontSize and axis.Label.FontSize are not independent properties. Setting axis.FontSize will not affect axis.Label.FontSize...

12 months ago | 1

Answered

Rotate 3-D Point Cloud Using Rigid Transformation

First translate the point cloud to the origin using a translation of -G. Rotate the point cloud around an axis. Translate it b...

Rotate 3-D Point Cloud Using Rigid Transformation

First translate the point cloud to the origin using a translation of -G. Rotate the point cloud around an axis. Translate it b...

12 months ago | 1

Answered

How to graph R0 against two parameters on a 3D plot with planes for certain R0 values?

[X,Y] = meshgrid(0:0.1:0.4, 0:0.01:0.4); R0 = 1; Z = R0 * ones(size(X)); surf(X,Y,Z) colormap('turbo') shading interp xlab...

How to graph R0 against two parameters on a 3D plot with planes for certain R0 values?

[X,Y] = meshgrid(0:0.1:0.4, 0:0.01:0.4); R0 = 1; Z = R0 * ones(size(X)); surf(X,Y,Z) colormap('turbo') shading interp xlab...

12 months ago | 0

| accepted

Answered

ode45 results won't plot

Your functions are a bit intertwined: solveODE_SecondOrder() function solveODE_SecondOrder() t = 0:.001:10; q0 = [0.1; 0.3...

ode45 results won't plot

Your functions are a bit intertwined: solveODE_SecondOrder() function solveODE_SecondOrder() t = 0:.001:10; q0 = [0.1; 0.3...

12 months ago | 0

Answered

I want to plane fit my sperical data points.

Assuming a spherical surface with unknown origin (and perhaps radius), you can run an optimization algorithm to estimate the mod...

I want to plane fit my sperical data points.

Assuming a spherical surface with unknown origin (and perhaps radius), you can run an optimization algorithm to estimate the mod...

12 months ago | 0

| accepted

Answered

how to convert z parameter to s parameter?

Depending on which way you want to go: % Ohm to dB Z = 4.17; ZdB = 20 * log10(Z) % dB to ohm ZdB = 12.39; Z = 10^(ZdB / ...

how to convert z parameter to s parameter?

Depending on which way you want to go: % Ohm to dB Z = 4.17; ZdB = 20 * log10(Z) % dB to ohm ZdB = 12.39; Z = 10^(ZdB / ...

12 months ago | 0

Answered

How to replace NAN values in a string to a zero value

Your for-loop is not a valid MATLAB expression. It should probably be: for i = 1:n end When i == 0, VW(i) would not be vali...

How to replace NAN values in a string to a zero value

Your for-loop is not a valid MATLAB expression. It should probably be: for i = 1:n end When i == 0, VW(i) would not be vali...

12 months ago | 0

Answered

how to smooth or filter the signal like this?

You can apply a low-pass filter to remove the noise in the signal before taking the Fourier Transform of the data: load('data.m...

how to smooth or filter the signal like this?

You can apply a low-pass filter to remove the noise in the signal before taking the Fourier Transform of the data: load('data.m...

12 months ago | 0

Answered

Why am I receiving multiple database errors for a simple line of code?

Your for loop index, i, goes up to size(ALPI01.time) and you are trying to index into the (i+1)th entry of the variable ALPI01...

Why am I receiving multiple database errors for a simple line of code?

Your for loop index, i, goes up to size(ALPI01.time) and you are trying to index into the (i+1)th entry of the variable ALPI01...

12 months ago | 0

| accepted