Answered

how can i normalize a plot

divide by signals by maximum value of EtRe. Something like this max_EtRe = max(Etre); EtRe_ = EtRe/max_EtRe; Etlm_ = Etlm/max...

how can i normalize a plot

divide by signals by maximum value of EtRe. Something like this max_EtRe = max(Etre); EtRe_ = EtRe/max_EtRe; Etlm_ = Etlm/max...

2 hours ago | 0

Answered

Why legend something wrong

No need to call loglog and scatter seperately. loglog() can do both % clear;clc;close all; h = [0.05 0.025 0.0125 0.00625 0...

Why legend something wrong

No need to call loglog and scatter seperately. loglog() can do both % clear;clc;close all; h = [0.05 0.025 0.0125 0.00625 0...

3 hours ago | 0

Answered

How can I write a function that replaces all of the multiples of eight or nine in a vector with seven, unless the multiple of eight or nine is also a multiple of seven.

Something like this x = 1:1000; mul7 = mod(x, 7)==0; mul8 = mod(x, 8)==0; mul9 = mod(x, 9)==0; mask = (mul8 | mul9) & (~m...

How can I write a function that replaces all of the multiples of eight or nine in a vector with seven, unless the multiple of eight or nine is also a multiple of seven.

Something like this x = 1:1000; mul7 = mod(x, 7)==0; mul8 = mod(x, 8)==0; mul9 = mod(x, 9)==0; mask = (mul8 | mul9) & (~m...

5 hours ago | 0

Answered

How can I save the final output in a matrix without manually save it on the image panel using patch?

Use getframe() to get the graphics as an image matrix x=[0 10 5]; y=[0 0 8.66]; patch(x,y,'white') set(gca,'Color','k','xti...

How can I save the final output in a matrix without manually save it on the image panel using patch?

Use getframe() to get the graphics as an image matrix x=[0 10 5]; y=[0 0 8.66]; patch(x,y,'white') set(gca,'Color','k','xti...

6 hours ago | 0

Answered

Evaluate definite integral numerically, where the function is indeterminate

If you have Symbolic toolbox, then you can try syms x Phi = 1; f(x) = x.*cosh(x)./( sinh(x).*(cosh(Phi*x)).^2 ); y = vpain...

Evaluate definite integral numerically, where the function is indeterminate

If you have Symbolic toolbox, then you can try syms x Phi = 1; f(x) = x.*cosh(x)./( sinh(x).*(cosh(Phi*x)).^2 ); y = vpain...

6 hours ago | 1

| accepted

Answered

How to have a surf plot displayed in a GUI (not as an external figure).

You need to pass app.UIAxes to all the other functions too. Otherwise, they will also create a new figure window. surf(app.UIAx...

How to have a surf plot displayed in a GUI (not as an external figure).

You need to pass app.UIAxes to all the other functions too. Otherwise, they will also create a new figure window. surf(app.UIAx...

6 hours ago | 0

Answered

How to show the color changing while comparing with grid size

You can use rescale() function. Change the contourf() line to this contourf(x,y,rescale(phi.', 0, 1));

How to show the color changing while comparing with grid size

You can use rescale() function. Change the contourf() line to this contourf(x,y,rescale(phi.', 0, 1));

6 hours ago | 0

Answered

creating a function that reads into the directory

you also need to use dir() to get actual file names. Try this code % FilePrefix ='DynamicData'; FilePrefix ='test'; Directory...

creating a function that reads into the directory

you also need to use dir() to get actual file names. Try this code % FilePrefix ='DynamicData'; FilePrefix ='test'; Directory...

6 hours ago | 0

Answered

Plotting two random vector

816 to 832 makes up 17 elements. So I guess the range should be 817 to 832. If the data is available in Table datatype, then you...

Plotting two random vector

816 to 832 makes up 17 elements. So I guess the range should be 817 to 832. If the data is available in Table datatype, then you...

6 hours ago | 0

Answered

is it possible to use cell array to define Lb and Ub of genetic algorithm in Optimization Toolbox

Define lb and ub as simple vectors. For example nvars = 18; lb = zeros(1, nvars); ub = ones(1, nvars) Also you need to pass ...

is it possible to use cell array to define Lb and Ub of genetic algorithm in Optimization Toolbox

Define lb and ub as simple vectors. For example nvars = 18; lb = zeros(1, nvars); ub = ones(1, nvars) Also you need to pass ...

7 hours ago | 0

Answered

tout (time) is not working

tout is only created after the simulation is complete. Therefore, you cannot use it as an input to gain. It seems that you want ...

tout (time) is not working

tout is only created after the simulation is complete. Therefore, you cannot use it as an input to gain. It seems that you want ...

9 hours ago | 0

Answered

How can I call sub-functions in the Main function

I haven't used MATLAB grader, but you should be able to call them like normal MATLAB functions. function main % name of main fu...

How can I call sub-functions in the Main function

I haven't used MATLAB grader, but you should be able to call them like normal MATLAB functions. function main % name of main fu...

9 hours ago | 0

Answered

Set interval for colorbar

Try this intervals = 0:0.1:1; clrs = bone(2*numel(intervals)-2); colormap(clrs); colorbar

Set interval for colorbar

Try this intervals = 0:0.1:1; clrs = bone(2*numel(intervals)-2); colormap(clrs); colorbar

9 hours ago | 0

Answered

ODE symbolic Boundary conditions in respect to another variable

You are correct. The equation is displayed incorrectly. It seems like a bug. However, it seems that this bug only affects the di...

ODE symbolic Boundary conditions in respect to another variable

You are correct. The equation is displayed incorrectly. It seems like a bug. However, it seems that this bug only affects the di...

9 hours ago | 0

| accepted

Answered

Can't plot all the four points among the inputs given in an OR Gate.

The way you are using plot() does not make much sense here. Using scatter() with y as the color value will show the difference f...

Can't plot all the four points among the inputs given in an OR Gate.

The way you are using plot() does not make much sense here. Using scatter() with y as the color value will show the difference f...

11 hours ago | 0

Answered

Settin spacing between Y-axis

Use daspect() plot(rand(1,10)*10); daspect([1 5 1]) % 1 unit of x-axis is equal to 5 units of y-axis Alternatively, try plot...

Settin spacing between Y-axis

Use daspect() plot(rand(1,10)*10); daspect([1 5 1]) % 1 unit of x-axis is equal to 5 units of y-axis Alternatively, try plot...

11 hours ago | 1

Answered

How can one show variable values in legend of a plot?

Run this example T = 1:3; Legends = compose('Temp is %d', T); hold on; plot(rand(1,10)); plot(rand(1,10)); plot(rand(1,1...

How can one show variable values in legend of a plot?

Run this example T = 1:3; Legends = compose('Temp is %d', T); hold on; plot(rand(1,10)); plot(rand(1,10)); plot(rand(1,1...

13 hours ago | 0

Answered

How to take and integral of a matrix

You can integrate a constant matrix by simply multiplying it with the length of the interval. M = [1 2]; M_int = M*(12-0) How...

How to take and integral of a matrix

You can integrate a constant matrix by simply multiplying it with the length of the interval. M = [1 2]; M_int = M*(12-0) How...

13 hours ago | 0

Answered

Displaying All the Related Items from an Input File

Try this str = fileread('test.txt'); str_words = cellfun(@(x) {strsplit(x, ' ')}, strsplit(str, '\n')); str_words = [vertca...

Displaying All the Related Items from an Input File

Try this str = fileread('test.txt'); str_words = cellfun(@(x) {strsplit(x, ' ')}, strsplit(str, '\n')); str_words = [vertca...

13 hours ago | 0

| accepted

Answered

Plotting multiple probability distribution plots in succession

Something like this M = rand(24, 200); % your matrix figure; for i=1:size(M,1) x = M(i, :); subplot(6, 4, i); ...

Plotting multiple probability distribution plots in succession

Something like this M = rand(24, 200); % your matrix figure; for i=1:size(M,1) x = M(i, :); subplot(6, 4, i); ...

14 hours ago | 0

| accepted

Answered

Subs function does not work on symbolic expressions and functions

You are overwriting the symbolic variable 'm' with numeric value on line m = solve(norm([5/m, 3/m, 0]) == 4.32, m); and after...

Subs function does not work on symbolic expressions and functions

You are overwriting the symbolic variable 'm' with numeric value on line m = solve(norm([5/m, 3/m, 0]) == 4.32, m); and after...

14 hours ago | 0

Answered

Removing DC component at 0 HZ from acceleration data after fft

As described here: http://blog.originlab.com/how-to-remove-dc-offset-before-performing-fft try using a high-pass filter to remov...

Removing DC component at 0 HZ from acceleration data after fft

As described here: http://blog.originlab.com/how-to-remove-dc-offset-before-performing-fft try using a high-pass filter to remov...

14 hours ago | 0

| accepted

Answered

How to capitalize words in a string (matlab)

"strrep() function is banned here". What about regexprep in = 'Hello Mello Jello Mello Hello'; out = regexprep(in, {'hello', '...

How to capitalize words in a string (matlab)

"strrep() function is banned here". What about regexprep in = 'Hello Mello Jello Mello Hello'; out = regexprep(in, {'hello', '...

14 hours ago | 0

Answered

How to plot with diferents colors

By default, the MATLAB axes only use seven colors to plot the lines. After that, the sequence is repeated if there are more then...

How to plot with diferents colors

By default, the MATLAB axes only use seven colors to plot the lines. After that, the sequence is repeated if there are more then...

14 hours ago | 0

Answered

Giving names to cells

Use iscell() function if ~iscell(output{i}) Also, note that save() will not accept indexing like this 'output{i}'. You will ne...

Giving names to cells

Use iscell() function if ~iscell(output{i}) Also, note that save() will not accept indexing like this 'output{i}'. You will ne...

14 hours ago | 0

Answered

Timeseries Plot Between a certain time interval

See the attached file (saved in R2020a) for one of the possible ways. It uses the MATLAB function block.

Timeseries Plot Between a certain time interval

See the attached file (saved in R2020a) for one of the possible ways. It uses the MATLAB function block.

14 hours ago | 0

Answered

resistor with random variable number not working

There is no need to add randn(1) in the resistor value. As the documentation page mentions: https://www.mathworks.com/help/simrf...

resistor with random variable number not working

There is no need to add randn(1) in the resistor value. As the documentation page mentions: https://www.mathworks.com/help/simrf...

14 hours ago | 0

Answered

Problems in solve iteratively calculation

If you look at the graph of this equation, you can see that it has two solutions in the interval [0 1]. syms dt2; f = (-2.4638...

Problems in solve iteratively calculation

If you look at the graph of this equation, you can see that it has two solutions in the interval [0 1]. syms dt2; f = (-2.4638...

15 hours ago | 0

| accepted

Answered

Importing a text or spreadsheet file to be used as a uitable.

Calling uitable() inside the function will tell MATLAB to create a new uitable. I suggest you to first add a UITable in the app ...

Importing a text or spreadsheet file to be used as a uitable.

Calling uitable() inside the function will tell MATLAB to create a new uitable. I suggest you to first add a UITable in the app ...

15 hours ago | 0

Answered

exportgraphics r2020a issue

I didn't face this problem in R2020a update 2, however, I remember observing something like this (not exactly sure if it was exp...

exportgraphics r2020a issue

I didn't face this problem in R2020a update 2, however, I remember observing something like this (not exactly sure if it was exp...

1 day ago | 0