Answered

y-axis are still inverted despite using fftshift

Your code doesn't run and you didn't include an image, but in general, when you call imagesc it will plot in ij coordinates, mea...

y-axis are still inverted despite using fftshift

Your code doesn't run and you didn't include an image, but in general, when you call imagesc it will plot in ij coordinates, mea...

17 days ago | 0

Answered

Set default value for axes LabelFontSizeMultiplier

The pattern is the same, or maybe I misunderstand the question? When you get defaults from groot, it won't show all defaults a...

Set default value for axes LabelFontSizeMultiplier

The pattern is the same, or maybe I misunderstand the question? When you get defaults from groot, it won't show all defaults a...

17 days ago | 0

| accepted

Answered

How to write a code in Matlab having two conditions?

In MATLAB indices start with 1: n=2048; %samples fs=1024; %sampling frequency T=1/fs; t = (0:n-1)*T; F=zeros(length(t)); ...

How to write a code in Matlab having two conditions?

In MATLAB indices start with 1: n=2048; %samples fs=1024; %sampling frequency T=1/fs; t = (0:n-1)*T; F=zeros(length(t)); ...

17 days ago | 0

| accepted

Answered

Invalid use of operator while trying to plot surface

A few issues: There's no .- in MATLAB, you use the dot to indicate you want a element-wise operation instead of a matrix operat...

Invalid use of operator while trying to plot surface

A few issues: There's no .- in MATLAB, you use the dot to indicate you want a element-wise operation instead of a matrix operat...

17 days ago | 0

| accepted

Answered

Is it possible to give an categorical date set values so it can be used for a plot.

Note that you can plot categorical variables in a variety of ways. Passing your categoricals directly into your plotting functio...

Is it possible to give an categorical date set values so it can be used for a plot.

Note that you can plot categorical variables in a variety of ways. Passing your categoricals directly into your plotting functio...

18 days ago | 0

| accepted

Answered

Finding an old .m file

This one has the same author and function signature, although I obviously can't say for sure if it's the same! https://github.c...

Finding an old .m file

This one has the same author and function signature, although I obviously can't say for sure if it's the same! https://github.c...

18 days ago | 0

| accepted

Answered

How can I save graphics as pdf?

What you typed should work, it should save the current figure (gcf) as myfigure.pdf to the current directory. I'd recommend usi...

How can I save graphics as pdf?

What you typed should work, it should save the current figure (gcf) as myfigure.pdf to the current directory. I'd recommend usi...

18 days ago | 1

| accepted

Answered

How to plot events over a signal?

@eyko you can plot the line with plot you can find the y values for the events with interp1, and plot them with plot or scatte...

How to plot events over a signal?

@eyko you can plot the line with plot you can find the y values for the events with interp1, and plot them with plot or scatte...

18 days ago | 0

| accepted

Answered

Remove whitespace right to colorbar

Do you mean in an export or as displayed in the figure window? For the export, if you use the newer exportgraphics instead of ...

Remove whitespace right to colorbar

Do you mean in an export or as displayed in the figure window? For the export, if you use the newer exportgraphics instead of ...

18 days ago | 0

| accepted

Answered

Difference between two statements

Switch doesn't provide new functionality but can make code easier to read and less complex: a='Apple'; These two blocks do t...

Difference between two statements

Switch doesn't provide new functionality but can make code easier to read and less complex: a='Apple'; These two blocks do t...

19 days ago | 1

Answered

how can I write a function

Your data look similar to this (as you've described them): load patients data=[{'name'} {'gender'} {'age'}; LastName Gender nu...

how can I write a function

Your data look similar to this (as you've described them): load patients data=[{'name'} {'gender'} {'age'}; LastName Gender nu...

20 days ago | 0

| accepted

Answered

plotting and reversing axis in subplot

I think I only see a bar and two plots. Here's some abbreviated code: t=tiledlayout(2,2); % or you can even do t=tiledlayout(...

plotting and reversing axis in subplot

I think I only see a bar and two plots. Here's some abbreviated code: t=tiledlayout(2,2); % or you can even do t=tiledlayout(...

20 days ago | 0

Answered

How to create multiple tables from a single spreadsheet

You can specify a range when calling readtable: For example: T = readtable('patients.xls',... 'Range','C2:E6',... ...

How to create multiple tables from a single spreadsheet

You can specify a range when calling readtable: For example: T = readtable('patients.xls',... 'Range','C2:E6',... ...

20 days ago | 0

| accepted

Answered

Coding colors with the use of combing matrices

One thing you could do is use uisetcolor to pick the exact shade of yellow orange and pink you like Another thing you could d...

Coding colors with the use of combing matrices

One thing you could do is use uisetcolor to pick the exact shade of yellow orange and pink you like Another thing you could d...

20 days ago | 0

Answered

How to get rid of floating-point constants

The error you describe isn't what I'd expect, but you're certainly missing a *. Unless exp isn't the matlab function exp and is ...

How to get rid of floating-point constants

The error you describe isn't what I'd expect, but you're certainly missing a *. Unless exp isn't the matlab function exp and is ...

21 days ago | 1

Answered

continuous signal to discrete

You didn't really describe what you tried and where you got stuck...how about a simplified example that has all of the building ...

continuous signal to discrete

You didn't really describe what you tried and where you got stuck...how about a simplified example that has all of the building ...

21 days ago | 0

Answered

How do you set every other row as well as every other column to zero?

To remove every other column, set it to empty. You can do "every other" generally using A:2:B where A is the first value and B i...

How do you set every other row as well as every other column to zero?

To remove every other column, set it to empty. You can do "every other" generally using A:2:B where A is the first value and B i...

21 days ago | 1

| accepted

Answered

Plot Mean over Box Charts using Positional and Color Grouping Variables

Boxchart makes this really difficult! The location of the categories is well defined, but the offset (while easy to calculate) i...

Plot Mean over Box Charts using Positional and Color Grouping Variables

Boxchart makes this really difficult! The location of the categories is well defined, but the offset (while easy to calculate) i...

21 days ago | 1

| accepted

Answered

How can I use multiple colormaps for contour plots ?

You can totally do this with three axes, I'm guessing the only bit you needed was to target the specific axes when setting the c...

How can I use multiple colormaps for contour plots ?

You can totally do this with three axes, I'm guessing the only bit you needed was to target the specific axes when setting the c...

21 days ago | 0

| accepted

Answered

How to signal divide into windows of lengths [1024] .

How about assembling up a matrix marking the indices of x you want. Of course you'll have to do something so that it's divisible...

How to signal divide into windows of lengths [1024] .

How about assembling up a matrix marking the indices of x you want. Of course you'll have to do something so that it's divisible...

21 days ago | 0

Answered

How to plot results from each iteration of a for loop SEPARATELY

You can do this in separate windows using the figure function: for i = 1:3 figure plot(rand(1,10)) end In separat...

How to plot results from each iteration of a for loop SEPARATELY

You can do this in separate windows using the figure function: for i = 1:3 figure plot(rand(1,10)) end In separat...

21 days ago | 1

| accepted

Answered

How can I create a matrix with matrix elements of different datatypes?

You can use a cell array to mix datatypes: n=5; mat = cell(n,2); for i = 1:n mat{i,1} = i; mat{i,2} = -i:i; end m...

How can I create a matrix with matrix elements of different datatypes?

You can use a cell array to mix datatypes: n=5; mat = cell(n,2); for i = 1:n mat{i,1} = i; mat{i,2} = -i:i; end m...

21 days ago | 0

Answered

Excel sheet extraction data

When you call readtable (or readmatrix or readcell) you can specify a range. I think the range has to be contiguous (i.e. you co...

Excel sheet extraction data

When you call readtable (or readmatrix or readcell) you can specify a range. I think the range has to be contiguous (i.e. you co...

21 days ago | 1

Answered

Questions about data types and tables

In your loop, X(:,i) is the contents of the table variable, and you're using it with dot indicating it as the name of the variab...

Questions about data types and tables

In your loop, X(:,i) is the contents of the table variable, and you're using it with dot indicating it as the name of the variab...

22 days ago | 0

| accepted

Answered

pdist2 output is larger than expected

pdist2 is providing all the pairwise distances. It compares row 1 of A with row 1 of B (Z(1,1)), then row 1 of A with row 2 of B...

pdist2 output is larger than expected

pdist2 is providing all the pairwise distances. It compares row 1 of A with row 1 of B (Z(1,1)), then row 1 of A with row 2 of B...

22 days ago | 0

| accepted

Answered

plot values MATLAB table with conditions

The mistake here is thinking about this as an if statement, instead you want to use what people often call logical indexing. In ...

plot values MATLAB table with conditions

The mistake here is thinking about this as an if statement, instead you want to use what people often call logical indexing. In ...

22 days ago | 0

| accepted

Answered

Replacing element in table

You can do point to table variables with the syntax tablename.variablename: X1=[9 6 9;3 2 7]; X2=[0 2;4 0]; X3=[3 1; 8 9]; X...

Replacing element in table

You can do point to table variables with the syntax tablename.variablename: X1=[9 6 9;3 2 7]; X2=[0 2;4 0]; X3=[3 1; 8 9]; X...

22 days ago | 0

| accepted

Answered

Matlab function doesnt run when called from AppDesigner

You're passing in characters containing numbers the values instead of the values themselves. Use str2num to convert before calli...

Matlab function doesnt run when called from AppDesigner

You're passing in characters containing numbers the values instead of the values themselves. Use str2num to convert before calli...

22 days ago | 0

| accepted

Answered

why my figure doesn't show the same logarithmic response like the one in the attached figure?.

I'm not sure how to match the y axis values, your equation didn't have much info about DPD, but it looks to me like you're missi...

why my figure doesn't show the same logarithmic response like the one in the attached figure?.

I'm not sure how to match the y axis values, your equation didn't have much info about DPD, but it looks to me like you're missi...

23 days ago | 0

| accepted

Answered

how can i obtain just the real part instead of immaginary part ?

The functions real and imag pull out the real and imaginary parts: X = sqrt(-rand(3))+rand(3) R = real(X) I = imag(X)

how can i obtain just the real part instead of immaginary part ?

The functions real and imag pull out the real and imaginary parts: X = sqrt(-rand(3))+rand(3) R = real(X) I = imag(X)

23 days ago | 0