Answered

How to create multiple plots for time series data?

While you may want to think about a cleaner way of dealing with the plot (e.g., plotting in the same figure window and saving), ...

How to create multiple plots for time series data?

While you may want to think about a cleaner way of dealing with the plot (e.g., plotting in the same figure window and saving), ...

3 days ago | 0

| accepted

Answered

Finite difference scheme used in 'CURL' function?

You can actually see the full code using edit curl it looks like everything is based on gradient, which appears to use a 2-poi...

Finite difference scheme used in 'CURL' function?

You can actually see the full code using edit curl it looks like everything is based on gradient, which appears to use a 2-poi...

4 days ago | 0

| accepted

Answered

Need help writing code to attach date (1-365) from 30 years of data to the actual data needed to be processed. Trying to group into months.

edit: final code for this case: "What I am working with is a 842,382x3 matrix where the first column is a repetition of numbers...

Need help writing code to attach date (1-365) from 30 years of data to the actual data needed to be processed. Trying to group into months.

edit: final code for this case: "What I am working with is a 842,382x3 matrix where the first column is a repetition of numbers...

4 days ago | 0

| accepted

Answered

Using randsample on a matrix of weights

it doesn't seem like the assignment statement has any reason to be in the loop. Pulling it out may save a decent amount of time ...

Using randsample on a matrix of weights

it doesn't seem like the assignment statement has any reason to be in the loop. Pulling it out may save a decent amount of time ...

5 days ago | 0

| accepted

Answered

Multiply local values of a matrix with a vector

I'm not quite clear on which columns you want to change, but take a look at this and see if it makes sense: % sample matrix >>...

Multiply local values of a matrix with a vector

I'm not quite clear on which columns you want to change, but take a look at this and see if it makes sense: % sample matrix >>...

5 days ago | 0

| accepted

Answered

Convert several columns char matrix into one column char matrix

join? >> tmp={'a' 'b' 'c' ; 'd' 'e' 'f'} tmp = 2×3 cell 'a' 'b' 'c' 'd' 'e' ...

Convert several columns char matrix into one column char matrix

join? >> tmp={'a' 'b' 'c' ; 'd' 'e' 'f'} tmp = 2×3 cell 'a' 'b' 'c' 'd' 'e' ...

6 days ago | 0

Answered

How to make a structure to be input of a function and then its updated version to be output of the function?

function new_struct = update_struct(old_struct,add_field, add_val) new_struct = old_struct; new_struct.(add_field) = a...

How to make a structure to be input of a function and then its updated version to be output of the function?

function new_struct = update_struct(old_struct,add_field, add_val) new_struct = old_struct; new_struct.(add_field) = a...

7 days ago | 0

| accepted

Answered

are there GPU settings in matlab?

Most code will not be run on the GPU without adjustment There are guides here and it looks pretty easy for many applications:...

are there GPU settings in matlab?

Most code will not be run on the GPU without adjustment There are guides here and it looks pretty easy for many applications:...

13 days ago | 0

Answered

how can i solve this error?and how can i get wavelet toolbox ?

Check here whether you have a license for it, or need to buy: https://www.mathworks.com/products/wavelet.html?s_tid=srchtitle#tr...

how can i solve this error?and how can i get wavelet toolbox ?

Check here whether you have a license for it, or need to buy: https://www.mathworks.com/products/wavelet.html?s_tid=srchtitle#tr...

13 days ago | 0

Answered

how to choose a random excel cell in a certain coloum

If you have R2019a or above, use readmatrix. But, the issue is that you are mixing up passing a variable and a string. It happ...

how to choose a random excel cell in a certain coloum

If you have R2019a or above, use readmatrix. But, the issue is that you are mixing up passing a variable and a string. It happ...

13 days ago | 0

Answered

Save data to Excel without overlapping

Check out writematrix: https://www.mathworks.com/help/matlab/ref/writematrix.html#mw_f36f6f84-e6bd-4749-8957-a88b07036116 Somet...

Save data to Excel without overlapping

Check out writematrix: https://www.mathworks.com/help/matlab/ref/writematrix.html#mw_f36f6f84-e6bd-4749-8957-a88b07036116 Somet...

13 days ago | 0

| accepted

Answered

how to make label y axis specific?

% if you want a label at 0, make sure to include it in your limits ylim([0 1000]) yticks([0 500 1000])

how to make label y axis specific?

% if you want a label at 0, make sure to include it in your limits ylim([0 1000]) yticks([0 500 1000])

15 days ago | 0

Answered

Converting nested "summary" structure to table

Here's the loop version. There may be another way, but I didn't have any luck fighting with Matlab's tricky multiple-cell return...

Converting nested "summary" structure to table

Here's the loop version. There may be another way, but I didn't have any luck fighting with Matlab's tricky multiple-cell return...

16 days ago | 0

| accepted

Answered

How to find the non-zero minimum of a subset of matrix elements

The issue is that logical indexing doesn't work when you are checking against a subset of the matrix: >> A = [1 2 3 4; 2 0 1 5;...

How to find the non-zero minimum of a subset of matrix elements

The issue is that logical indexing doesn't work when you are checking against a subset of the matrix: >> A = [1 2 3 4; 2 0 1 5;...

16 days ago | 0

| accepted

Answered

Changing the number of xticks on heatmat (without changing the data)

Try: xt=xticks; xticks(xt(1:10:end)) If that doesn't work, it sounds like ax = gca; ax.XDisplayData = [date(1:10:end)]; % ...

Changing the number of xticks on heatmat (without changing the data)

Try: xt=xticks; xticks(xt(1:10:end)) If that doesn't work, it sounds like ax = gca; ax.XDisplayData = [date(1:10:end)]; % ...

16 days ago | 1

Answered

Extract row data from a table as a result of intervals (boundaries) being called in from a different structure

Does this do it? % generate some random data 0-1 DATA = rand(328,338); % set the lower and upper bounds to extract as 0.25 an...

Extract row data from a table as a result of intervals (boundaries) being called in from a different structure

Does this do it? % generate some random data 0-1 DATA = rand(328,338); % set the lower and upper bounds to extract as 0.25 an...

24 days ago | 0

| accepted

Answered

Discrete fourier transform (DFT) Question

Check out this example from the angle documentation: https://www.mathworks.com/help/matlab/ref/angle.html#mw_9b727746-7db3-4b26-...

Discrete fourier transform (DFT) Question

Check out this example from the angle documentation: https://www.mathworks.com/help/matlab/ref/angle.html#mw_9b727746-7db3-4b26-...

24 days ago | 0

Answered

how to load a matfile and access & process its content.

% create a structure with field 'somefield' containing the desired filename mystruct = struct('somefield','execution') % creat...

how to load a matfile and access & process its content.

% create a structure with field 'somefield' containing the desired filename mystruct = struct('somefield','execution') % creat...

25 days ago | 1

Answered

Deleting/selecting and subsetting specific slices in a multi-dimensional array

This may not be the most efficient way, but you can take that 2D logical array and rebuild your 3D logical array: subset_3D = a...

Deleting/selecting and subsetting specific slices in a multi-dimensional array

This may not be the most efficient way, but you can take that 2D logical array and rebuild your 3D logical array: subset_3D = a...

1 month ago | 0

| accepted

Answered

what is the physical meaning of getting peak of higher amplitude in frequency domain by using FFT??

Assuming you kept track of normalization correctly(*), yes, a higher amplitude of the fft corresponds to higher signal strength ...

what is the physical meaning of getting peak of higher amplitude in frequency domain by using FFT??

Assuming you kept track of normalization correctly(*), yes, a higher amplitude of the fft corresponds to higher signal strength ...

2 months ago | 0

| accepted

Answered

Can matlab work with NVIDIA 2gb Graphics card?

It depends on what you're trying to do, but I would think you should be fine. I worked for years on a 8 GB RAM / 1 GB GPU machin...

Can matlab work with NVIDIA 2gb Graphics card?

It depends on what you're trying to do, but I would think you should be fine. I worked for years on a 8 GB RAM / 1 GB GPU machin...

2 months ago | 0

| accepted

Answered

Does FFT output vary if I split a signal into windowed time segments instead of using a Hanning Window?

A few things to consider: more time-domain elements --> finer frequency domain spacing. treating the three cuts the same will ...

Does FFT output vary if I split a signal into windowed time segments instead of using a Hanning Window?

A few things to consider: more time-domain elements --> finer frequency domain spacing. treating the three cuts the same will ...

2 months ago | 0

| accepted

Answered

Placing a structure within a map container - or is there a different, more suitable way to store this type of data?

You can give tables row names so they are indexible that way: keys = {'Jan','Feb','Mar'}; n_keys = length(keys); data_table =...

Placing a structure within a map container - or is there a different, more suitable way to store this type of data?

You can give tables row names so they are indexible that way: keys = {'Jan','Feb','Mar'}; n_keys = length(keys); data_table =...

2 months ago | 2

Answered

Matlab Tasks from proffesor

First one: define symbolic variables write out the expression in linear math notation ask Matlab to rewrite the equation as s...

Matlab Tasks from proffesor

First one: define symbolic variables write out the expression in linear math notation ask Matlab to rewrite the equation as s...

2 months ago | 0

| accepted

Answered

Reading a N columns table which sometimes have N+1 columns

Assuming you don't need the '**' info, you could try this solution from the fscanf examples which skips the remainder of the lin...

Reading a N columns table which sometimes have N+1 columns

Assuming you don't need the '**' info, you could try this solution from the fscanf examples which skips the remainder of the lin...

2 months ago | 0

| accepted

Answered

1. For x from 1 to 100, calculate y. Use fopen and fprintf to write x and y data into a file named “my_data.txt”. Then use fopen and fscanf to read the data. Show the data in two columns. Function to be used: y = e^(0.02x)

Please don't post homework problems without showing your attempts and asking specific questions. I'm feeling generous, though, s...

1. For x from 1 to 100, calculate y. Use fopen and fprintf to write x and y data into a file named “my_data.txt”. Then use fopen and fscanf to read the data. Show the data in two columns. Function to be used: y = e^(0.02x)

Please don't post homework problems without showing your attempts and asking specific questions. I'm feeling generous, though, s...

2 months ago | 0

| accepted

Answered

MATLAB Answers Wish-list #5 (and bug reports)

Add a set of pre-written comments for common situations. Things like: "this is clearly a homework problem, please display some ...

MATLAB Answers Wish-list #5 (and bug reports)

Add a set of pre-written comments for common situations. Things like: "this is clearly a homework problem, please display some ...

2 months ago | 4

Answered

Monthly Average from Daily Data

See findgroups for taking the mean based on a grouping variable. See month for converting a datetime variable to its month See...

Monthly Average from Daily Data

See findgroups for taking the mean based on a grouping variable. See month for converting a datetime variable to its month See...

2 months ago | 0

Answered

How to vectorize this code?

frequency=randi([0 578],110,1); axis=[-275:5:270]'; % get indices where axis is negative axis_negative = (axis<=0); % calcul...

How to vectorize this code?

frequency=randi([0 578],110,1); axis=[-275:5:270]'; % get indices where axis is negative axis_negative = (axis<=0); % calcul...

2 months ago | 0

| accepted

Answered

how to use for loop to compute a matrix

Assuming each one produces a 25 x 12852 dist array, you can do this fairly easily. Which dimension do you want to concatenate on...

how to use for loop to compute a matrix

Assuming each one produces a 25 x 12852 dist array, you can do this fairly easily. Which dimension do you want to concatenate on...

2 months ago | 0

| accepted