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

10 days ago | 0

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

11 days 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 ...

11 days 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 =...

16 days 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...

18 days 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...

22 days 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...

22 days 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 ...

23 days ago | 3

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

23 days 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...

23 days 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...

23 days ago | 0

| accepted

Answered

Access data in a nested structure array and generate an excel file

[Edited with fixed answer, x2] This throws no errors and appears to produce a correct excel file from your sample data: files ...

Access data in a nested structure array and generate an excel file

[Edited with fixed answer, x2] This throws no errors and appears to produce a correct excel file from your sample data: files ...

23 days ago | 0

| accepted

Answered

How to write a function which handles strings?

Live editor functionality changes a lot across versions, but my suggestion would be to put your function in a separate cell from...

How to write a function which handles strings?

Live editor functionality changes a lot across versions, but my suggestion would be to put your function in a separate cell from...

23 days ago | 0

| accepted

Answered

How to create a custom colormap in this case?

That is essentially the example here. Using the hex -> rgb converter from this answer: % test image imagesc(rand(10,10)) col...

How to create a custom colormap in this case?

That is essentially the example here. Using the hex -> rgb converter from this answer: % test image imagesc(rand(10,10)) col...

24 days ago | 1

| accepted

Answered

Is there any way to output coordinates of a point?

If you want to get the data for an arbirtrary point in your graph, you can add a datatip by clicking with the cursor, then right...

Is there any way to output coordinates of a point?

If you want to get the data for an arbirtrary point in your graph, you can add a datatip by clicking with the cursor, then right...

24 days ago | 0

| accepted

Answered

Add various horizontal lines to a plot Matlab 2016a

See here for a few solutions: https://www.mathworks.com/matlabcentral/answers/2031-adding-vertical-line-to-plot

Add various horizontal lines to a plot Matlab 2016a

See here for a few solutions: https://www.mathworks.com/matlabcentral/answers/2031-adding-vertical-line-to-plot

24 days ago | 0

Answered

Scatter Plot only Non-Zero Set of Points

Here's how to do this with a small example script: % create a 5x2 array of random integers 0-5 for both x and y x = randi([0 5...

Scatter Plot only Non-Zero Set of Points

Here's how to do this with a small example script: % create a 5x2 array of random integers 0-5 for both x and y x = randi([0 5...

24 days ago | 0

| accepted

Answered

Operate on all the columns of a matrix

"N = normalize(A,dim) returns the z-score along dimension dim. For example, normalize(A,2) normalizes each row." norm_mat=norma...

Operate on all the columns of a matrix

"N = normalize(A,dim) returns the z-score along dimension dim. For example, normalize(A,2) normalizes each row." norm_mat=norma...

29 days ago | 0

Answered

How to make only some part of a y axis label italic? (in boxplot?)

Set the tick label interpreter to tex: ax=gca; ax.TickLabelInterpreter = 'tex'; or set(gca,'TickLabelInterpreter','tex')

How to make only some part of a y axis label italic? (in boxplot?)

Set the tick label interpreter to tex: ax=gca; ax.TickLabelInterpreter = 'tex'; or set(gca,'TickLabelInterpreter','tex')

29 days ago | 0

Answered

How to find the min, max and mean values of 34 timetables stored in a 1 x 34 cell and add them as extra columns to the respective timetables?

Is this what you want to do: Load in a given table (say jj=1) create TT2{1} find the min of TT{1}.temperature add a third co...

How to find the min, max and mean values of 34 timetables stored in a 1 x 34 cell and add them as extra columns to the respective timetables?

Is this what you want to do: Load in a given table (say jj=1) create TT2{1} find the min of TT{1}.temperature add a third co...

29 days ago | 0

Answered

How can I set a discontinuous colormap and colorbar range?

Potential solution: Shift the data into a continuous range, then relable the colorbar: cont_data = mydata; % move [351 - 360 ...

How can I set a discontinuous colormap and colorbar range?

Potential solution: Shift the data into a continuous range, then relable the colorbar: cont_data = mydata; % move [351 - 360 ...

29 days ago | 1

| accepted

Answered

Summation of numbers using prompts

Two errors: The function should not have n as an argument. Wait to ask the user don't use "sum" as a variable name; it's a fun...

Summation of numbers using prompts

Two errors: The function should not have n as an argument. Wait to ask the user don't use "sum" as a variable name; it's a fun...

1 month ago | 0

| accepted

Answered

How to compare strings within a loop

No need to loop, strcmpi will compare a string to all strings in an array. If you don't care which string matches, use "any": s...

How to compare strings within a loop

No need to loop, strcmpi will compare a string to all strings in an array. If you don't care which string matches, use "any": s...

1 month ago | 0

| accepted

Answered

I have a timetable with 10 columns that are all binary and I want to add them together so I get a sum of those binary numbers for each row. Is there an easy way to do this?

% example table mytable=array2table(randi([0 1],20,10)); % create column variable with sum sum_all = sum(mytable{:,1:10},2); ...

I have a timetable with 10 columns that are all binary and I want to add them together so I get a sum of those binary numbers for each row. Is there an easy way to do this?

% example table mytable=array2table(randi([0 1],20,10)); % create column variable with sum sum_all = sum(mytable{:,1:10},2); ...

1 month ago | 0

Answered

Plot Problem in Matlab

Assuming you have edited the matlabrc, it may be as simple as you having a scalar logical operator (&&, ||) instead of an elemen...

Plot Problem in Matlab

Assuming you have edited the matlabrc, it may be as simple as you having a scalar logical operator (&&, ||) instead of an elemen...

1 month ago | 0

Answered

Modifying a function for the trapezoidal rule to work with a data set instead of an equation?

My suggestion is to check out the built-in trapz function. There are a few formulas there that should help. Another note: your ...

Modifying a function for the trapezoidal rule to work with a data set instead of an equation?

My suggestion is to check out the built-in trapz function. There are a few formulas there that should help. Another note: your ...

1 month ago | 0

| accepted

Answered

how to preserve original column headings (variable names) when using writetable

As of 2019b, table variable names don't need to follow normal variable naming rules. This allows for a couple of fixes: T = rea...

how to preserve original column headings (variable names) when using writetable

As of 2019b, table variable names don't need to follow normal variable naming rules. This allows for a couple of fixes: T = rea...

1 month ago | 0

| accepted

Answered

How can I change the size of the text in annotation, and place a border around it?

You are setting the width and height of the box to 0. I believe this should do it, but check here for other properties you may ...

How can I change the size of the text in annotation, and place a border around it?

You are setting the width and height of the box to 0. I believe this should do it, but check here for other properties you may ...

1 month ago | 0

| accepted

Answered

Creating a Tabular Legend

Not a good solution, but with some fiddling gets pretty close: myleg=compose('%-8s%10d',["Boot";"Engine";"Wheel"],[1 3 5]'); m...

Creating a Tabular Legend

Not a good solution, but with some fiddling gets pretty close: myleg=compose('%-8s%10d',["Boot";"Engine";"Wheel"],[1 3 5]'); m...

1 month ago | 1

| accepted

Answered

Change meshgrid face color

surf(Ltm, Lnm, Pm,'FaceAlpha',0.5) to set transparency to 50%. See other options here

Change meshgrid face color

surf(Ltm, Lnm, Pm,'FaceAlpha',0.5) to set transparency to 50%. See other options here

1 month ago | 0

| accepted