Answered

2d to 3d array conversion

First convert tables to arrays and then use cat() for i=1:14641 a{i} = readtable(strcat('output_',num2str(i),'.csv')); end a...

2d to 3d array conversion

First convert tables to arrays and then use cat() for i=1:14641 a{i} = readtable(strcat('output_',num2str(i),'.csv')); end a...

circa un'ora ago | 0

Answered

VolumeViewer ScaleFactors not working in R2018b

ScaleFactor was not present in R2018b: https://www.mathworks.com/help/releases/R2018b/images/ref/volumeviewer-app.html?searchHig...

VolumeViewer ScaleFactors not working in R2018b

ScaleFactor was not present in R2018b: https://www.mathworks.com/help/releases/R2018b/images/ref/volumeviewer-app.html?searchHig...

circa 3 ore ago | 0

Answered

expanding a given function as a power series?

You need the symbolic toolbox for this problem! syms x y f(x) = x^3+2*x; g = f(exp(y)); g_approx = taylor(g, y, 'Order', 1...

expanding a given function as a power series?

You need the symbolic toolbox for this problem! syms x y f(x) = x^3+2*x; g = f(exp(y)); g_approx = taylor(g, y, 'Order', 1...

circa 4 ore ago | 1

| accepted

Answered

how to get data from an interval

You can use logical indexing. Add these lines at the end of your code x = sol.x; y = sol.y; idx = (x > 50) & (x < 180); fi...

how to get data from an interval

You can use logical indexing. Add these lines at the end of your code x = sol.x; y = sol.y; idx = (x > 50) & (x < 180); fi...

circa 5 ore ago | 0

| accepted

Answered

How can I change the linewidth in a pzmap?

This is one way fig = figure(); ax = axes(); s = tf('s'); G=s+3/((s+4)*(s^2+1)); pzmap(ax, G); l_zero = findall(ax, 'tag...

How can I change the linewidth in a pzmap?

This is one way fig = figure(); ax = axes(); s = tf('s'); G=s+3/((s+4)*(s^2+1)); pzmap(ax, G); l_zero = findall(ax, 'tag...

circa 6 ore ago | 0

Answered

Count using mod function

The following example show how to find the even number in a vector using mod(). You can extend it to other cases x = [1 4 3 2 1...

Count using mod function

The following example show how to find the even number in a vector using mod(). You can extend it to other cases x = [1 4 3 2 1...

circa 6 ore ago | 0

Answered

Additive White Gaussian Noise

You can generate the sine wave using sin() function: https://www.mathworks.com/help/matlab/ref/sin.html. Note that you can get a...

Additive White Gaussian Noise

You can generate the sine wave using sin() function: https://www.mathworks.com/help/matlab/ref/sin.html. Note that you can get a...

circa 6 ore ago | 0

Answered

Averaging oscillating data points

Try lowpass filter if you have signal processing toolbox data = readmatrix('SampleTempData.xlsx'); t = data(:,1); x = data(...

Averaging oscillating data points

Try lowpass filter if you have signal processing toolbox data = readmatrix('SampleTempData.xlsx'); t = data(:,1); x = data(...

circa 7 ore ago | 1

Answered

My Colored image gets read as a bw image

MATLAB is loading it as an indexed image: https://www.mathworks.com/help/images/image-types-in-the-toolbox.html#f14-17587. The f...

My Colored image gets read as a bw image

MATLAB is loading it as an indexed image: https://www.mathworks.com/help/images/image-types-in-the-toolbox.html#f14-17587. The f...

circa 7 ore ago | 0

| accepted

Answered

syntax of matlab code

You can write-click on the name of the function and click open "Function name". It will take you to the corresponding function u...

syntax of matlab code

You can write-click on the name of the function and click open "Function name". It will take you to the corresponding function u...

circa 9 ore ago | 0

Answered

Entering Data to plot Graphs

Just entering as an array would be fine. See plot(): https://www.mathworks.com/help/matlab/ref/plot.html. Here is a very simple ...

Entering Data to plot Graphs

Just entering as an array would be fine. See plot(): https://www.mathworks.com/help/matlab/ref/plot.html. Here is a very simple ...

circa 10 ore ago | 0

Answered

How can I coding this function correctly?

Since this is a homework question so I won't be giving exact code, but you can read the documentation of the following functions...

How can I coding this function correctly?

Since this is a homework question so I won't be giving exact code, but you can read the documentation of the following functions...

circa 11 ore ago | 0

Answered

How to make a text figure close after an input command, how do I also make a text figure show up after an input command

You can use close() x = {'Choose the number you would like to solve'; '1 = Kinetic Energy';'2 = Potential Energy';'3 = Net Forc...

How to make a text figure close after an input command, how do I also make a text figure show up after an input command

You can use close() x = {'Choose the number you would like to solve'; '1 = Kinetic Energy';'2 = Potential Energy';'3 = Net Forc...

circa 11 ore ago | 0

Answered

The Eigenvalues of a large matrix don't cross each other when plotted

Yes, this is a very common problem with MATLAB's eig function, and John has created this excellent package to solve this problem...

The Eigenvalues of a large matrix don't cross each other when plotted

Yes, this is a very common problem with MATLAB's eig function, and John has created this excellent package to solve this problem...

circa 22 ore ago | 0

| accepted

Answered

perform matrix operation without for loop

Following code is equivalent xe = zeros([size(exp_data) numel(beta)]); mask = exp_data > 1.5; for m = 1:numel(beta) xes ...

perform matrix operation without for loop

Following code is equivalent xe = zeros([size(exp_data) numel(beta)]); mask = exp_data > 1.5; for m = 1:numel(beta) xes ...

circa 23 ore ago | 0

Answered

Can someone help me write a code to generate a random matrix like the one in the picture?

See blkdiag(): https://www.mathworks.com/help/matlab/ref/blkdiag.html. It is made specifically for this purpose. For example d ...

Can someone help me write a code to generate a random matrix like the one in the picture?

See blkdiag(): https://www.mathworks.com/help/matlab/ref/blkdiag.html. It is made specifically for this purpose. For example d ...

circa 23 ore ago | 0

| accepted

Answered

Set facecolor in app designer

No need to pass app.UIAxes in these lines set(pie(1),'facecolor',[255 85 180]./255); set(pie(2),'facecolor',[255 0 0]./255);

Set facecolor in app designer

No need to pass app.UIAxes in these lines set(pie(1),'facecolor',[255 85 180]./255); set(pie(2),'facecolor',[255 0 0]./255);

circa 23 ore ago | 0

| accepted

Answered

Calculating seasonal mean of precipitation from 25 years daily data

See retime(): https://www.mathworks.com/help/matlab/ref/timetable.retime.html

Calculating seasonal mean of precipitation from 25 years daily data

See retime(): https://www.mathworks.com/help/matlab/ref/timetable.retime.html

circa 24 ore ago | 0

Answered

Diagonal slices of 3D array

The question is not entirely clear, so the following is my guess, but such a problem can be solved using sub2ind(). C = % 2N*N*...

Diagonal slices of 3D array

The question is not entirely clear, so the following is my guess, but such a problem can be solved using sub2ind(). C = % 2N*N*...

1 giorno ago | 1

Answered

Ues waitforbuttonpress for key press only

Instead of waitforbuttonpress, use KeyPress callback for the figure object: https://www.mathworks.com/help/matlab/ref/matlab.ui....

Ues waitforbuttonpress for key press only

Instead of waitforbuttonpress, use KeyPress callback for the figure object: https://www.mathworks.com/help/matlab/ref/matlab.ui....

1 giorno ago | 0

Answered

Direction between points from [0,360]

Add 2pi to negative values. x = -1; y = -1; theta = atan2(y, x); if theta < 0 theta = theta + 2*pi; end

Direction between points from [0,360]

Add 2pi to negative values. x = -1; y = -1; theta = atan2(y, x); if theta < 0 theta = theta + 2*pi; end

1 giorno ago | 0

Answered

How can I crop several regions from a video and plot all the signals of rgb values in the same graph?

Check this code vid = VideoReader('respiration.mp4'); I = cell(1, 3); rects = zeros(3, 4); numFrames = vid.NumFrames; % go...

How can I crop several regions from a video and plot all the signals of rgb values in the same graph?

Check this code vid = VideoReader('respiration.mp4'); I = cell(1, 3); rects = zeros(3, 4); numFrames = vid.NumFrames; % go...

1 giorno ago | 0

| accepted

Answered

Change filename of all files in folder to have underscore instead of space

Something like this d = uigetdir(pwd, 'Select a folder'); files = dir(fullfile(d, '*.s2p')); for i = 1:numel(files) or...

Change filename of all files in folder to have underscore instead of space

Something like this d = uigetdir(pwd, 'Select a folder'); files = dir(fullfile(d, '*.s2p')); for i = 1:numel(files) or...

1 giorno ago | 0

Answered

Create vector of monthly means from arbitary time format and vector of sampled temperatures.

See retime(): https://www.merriam-webster.com/dictionary/retime . For a more specific example, please attach a sample dataset.

Create vector of monthly means from arbitary time format and vector of sampled temperatures.

See retime(): https://www.merriam-webster.com/dictionary/retime . For a more specific example, please attach a sample dataset.

1 giorno ago | 0

Answered

how to solve a fourth degree polynomial for x / polyval for x

What about reversing the interpolation y_sample=[18.5610 21.298 27.531 36.8 51.221]; % test data x_sample = (0...

how to solve a fourth degree polynomial for x / polyval for x

What about reversing the interpolation y_sample=[18.5610 21.298 27.531 36.8 51.221]; % test data x_sample = (0...

1 giorno ago | 0

| accepted

Answered

Heatmap: Vector of x values contains duplicate values

Instead of XData and YData, change XDisplayLabels and YDisplayLabels. h.YDisplayLabels = ["E10" "E9" "E8" "E7" "E6" "E5" "E4" "...

Heatmap: Vector of x values contains duplicate values

Instead of XData and YData, change XDisplayLabels and YDisplayLabels. h.YDisplayLabels = ["E10" "E9" "E8" "E7" "E6" "E5" "E4" "...

1 giorno ago | 0

| accepted

Answered

How to solve this equation on MATLAB ? how to get the value of x

You can use fsolve() f = @(x) (30\((0.45+0.1233*x)*(12+0.2958*x)))-(2.41*((0.57-0.11789*x)^(-0.77))); x_sol = fsolve(f, rand()...

How to solve this equation on MATLAB ? how to get the value of x

You can use fsolve() f = @(x) (30\((0.45+0.1233*x)*(12+0.2958*x)))-(2.41*((0.57-0.11789*x)^(-0.77))); x_sol = fsolve(f, rand()...

1 giorno ago | 0

Answered

How do i use an unknown from an unsolved identity in my equations?

There are some syntax issues in your code. Check the following code clear all clc syms m m_ = solve(m+6==4-m, m); x= 0:1:10...

How do i use an unknown from an unsolved identity in my equations?

There are some syntax issues in your code. Check the following code clear all clc syms m m_ = solve(m+6==4-m, m); x= 0:1:10...

1 giorno ago | 0

| accepted

Answered

How to make a list of appearance

Use findgrpups() and histcounts(). Something like this names = ["cat" "dog" "cat" "cat" "dog"]; [n, unique_names] = findgroups...

How to make a list of appearance

Use findgrpups() and histcounts(). Something like this names = ["cat" "dog" "cat" "cat" "dog"]; [n, unique_names] = findgroups...

1 giorno ago | 0

| accepted

Answered

Access Field from Struct

You need to use concatenation brackets [ ] a=[structname.MeansArea] Read here: https://www.mathworks.com/help/matlab/ref/doubl...

Access Field from Struct

You need to use concatenation brackets [ ] a=[structname.MeansArea] Read here: https://www.mathworks.com/help/matlab/ref/doubl...

1 giorno ago | 0

| accepted