Answered

Omit nans from data set when calculating weights

You can use fillmissing to replace any NaN with 0, so that it doesn't contribute to the weighted sum. Give the resulting timeta...

Omit nans from data set when calculating weights

You can use fillmissing to replace any NaN with 0, so that it doesn't contribute to the weighted sum. Give the resulting timeta...

5 days ago | 0

| accepted

Answered

After using "shading interp", the image will cover my satellite basemap. How to solve it?

Try applying the shading only to the pcolorm surface object: t=pcolorm(double(Latitude), double(Longitude), Precip_ZN, 'FaceCol...

After using "shading interp", the image will cover my satellite basemap. How to solve it?

Try applying the shading only to the pcolorm surface object: t=pcolorm(double(Latitude), double(Longitude), Precip_ZN, 'FaceCol...

5 days ago | 1

| accepted

Answered

How do I load in multiple datasets from multiple folders?

You can use * and/or ** wildcards in dir. Example: folder = 'absolute\or\relative\path\to\folder\3D\amplitude'; dir_str = f...

How do I load in multiple datasets from multiple folders?

You can use * and/or ** wildcards in dir. Example: folder = 'absolute\or\relative\path\to\folder\3D\amplitude'; dir_str = f...

5 days ago | 0

Answered

Why does it skips the if part?

MATLAB doesn't ignore the if statement; the condition is never true. You can print the values of G(1,i) and G(1,i-1) with more ...

Why does it skips the if part?

MATLAB doesn't ignore the if statement; the condition is never true. You can print the values of G(1,i) and G(1,i-1) with more ...

5 days ago | 0

Answered

How to dynamically change name of table?

One way to plot the table data for each cycle separately, without having to create a new table variable for each cycle, is to us...

How to dynamically change name of table?

One way to plot the table data for each cycle separately, without having to create a new table variable for each cycle, is to us...

5 days ago | 0

| accepted

Answered

How to scatter plot

"It is because my X is a 1x16 double and my Z is a 1x32 double." That's true. That is the problem. "When i do [X1,X2], it just...

How to scatter plot

"It is because my X is a 1x16 double and my Z is a 1x32 double." That's true. That is the problem. "When i do [X1,X2], it just...

6 days ago | 0

| accepted

Answered

Two y-Axes plot order and legend issue

With yyaxis, I don't think there is a way to set which axes' lines show up in front of the other. However, a workaround is to cr...

Two y-Axes plot order and legend issue

With yyaxis, I don't think there is a way to set which axes' lines show up in front of the other. However, a workaround is to cr...

6 days ago | 0

| accepted

Answered

Want to extract the earliest date for each subject

groupsummary(X,'SubjNum','min','Dates')

Want to extract the earliest date for each subject

groupsummary(X,'SubjNum','min','Dates')

6 days ago | 0

Answered

Average of Column in matlab.

avg = mean(M,1); where M is your matrix.

Average of Column in matlab.

avg = mean(M,1); where M is your matrix.

6 days ago | 2

| accepted

Answered

How can I plot multiple Matlab files onto one boxplot?

One problem is that you are assuming the list of files returned by dir is in a particular order (7, 8, 9, 10), but in fact the o...

How can I plot multiple Matlab files onto one boxplot?

One problem is that you are assuming the list of files returned by dir is in a particular order (7, 8, 9, 10), but in fact the o...

6 days ago | 0

| accepted

Answered

write matrix, appending data

Instead of writecell([C,filename,'Sheet',Tag,'Range','A',nextI-1]); writematrix([ppm_data', filename,'Sheet',Tag,,'Range','A',...

write matrix, appending data

Instead of writecell([C,filename,'Sheet',Tag,'Range','A',nextI-1]); writematrix([ppm_data', filename,'Sheet',Tag,,'Range','A',...

6 days ago | 0

| accepted

Answered

Adding Means to a matrix

Like this? D = rand(500,30); % data M = mean(D,1); % mean of each column of data whos D M % add each column to its mean: ...

Adding Means to a matrix

Like this? D = rand(500,30); % data M = mean(D,1); % mean of each column of data whos D M % add each column to its mean: ...

6 days ago | 0

Answered

TiledLayout with titles spanning multiple tiles (but not all)

Here's one way, using nested tiledlayouts: figure('Position',[10 10 800 600]); colors = [0 0.6 0; 0.9 0.7 0.1; 1 0.4 0.2; 1 0 ...

TiledLayout with titles spanning multiple tiles (but not all)

Here's one way, using nested tiledlayouts: figure('Position',[10 10 800 600]); colors = [0 0.6 0; 0.9 0.7 0.1; 1 0.4 0.2; 1 0 ...

6 days ago | 1

| accepted

Answered

How to make a dropdown menu

"I was having problems where only the invalid selection was being made" That's because, in the words of the uicontrol propertie...

How to make a dropdown menu

"I was having problems where only the invalid selection was being made" That's because, in the words of the uicontrol propertie...

6 days ago | 0

Answered

Ploting multiple traces with different colors. plot(x,y, 'color', 'red') not working

'color' is not a valid parameter to pass to rfdata.plot https://www.mathworks.com/help/rf/ref/plot.html Try setting the color ...

Ploting multiple traces with different colors. plot(x,y, 'color', 'red') not working

'color' is not a valid parameter to pass to rfdata.plot https://www.mathworks.com/help/rf/ref/plot.html Try setting the color ...

6 days ago | 0

| accepted

Answered

Find faster way than compose to format table

Rather than trying to find a faster alternative to compose to convert table data to appropriately formatting strings, the real p...

Find faster way than compose to format table

Rather than trying to find a faster alternative to compose to convert table data to appropriately formatting strings, the real p...

7 days ago | 0

Answered

How to write a matrix with a variable inside it?

Do you mean for x to be a symbolic variable? syms x B = [0 1 2*x 3*x^2] B.' Or for x to be a numeric variable? x = 2.2; ...

How to write a matrix with a variable inside it?

Do you mean for x to be a symbolic variable? syms x B = [0 1 2*x 3*x^2] B.' Or for x to be a numeric variable? x = 2.2; ...

7 days ago | 1

| accepted

Answered

How to equally stretch horizontal bars?

Here's your code, with formatting applied and a hold on included and the colors variable defined: dataStart = [1, 2, 3, 4; 4, 5...

How to equally stretch horizontal bars?

Here's your code, with formatting applied and a hold on included and the colors variable defined: dataStart = [1, 2, 3, 4; 4, 5...

7 days ago | 0

| accepted

Answered

How to get Matlab datatip to output subplot information?

clc clearvars close all figure('units','normalized','Position',[0.15 0.45 0.7 0.55]); for j1=1:2 sbp1(j1)=subplot(1,2...

How to get Matlab datatip to output subplot information?

clc clearvars close all figure('units','normalized','Position',[0.15 0.45 0.7 0.55]); for j1=1:2 sbp1(j1)=subplot(1,2...

7 days ago | 0

Answered

minimum point in nested for loop and using min function..i want to know the value of x for which every row of y has minimum elements please help

clear;clc;close; u1=1:1:3; u2=0:0.1:1.1; for jj=1:length(u1) % s1=inf; for kk=1:length(u2) x(jj,kk)=u1(j...

minimum point in nested for loop and using min function..i want to know the value of x for which every row of y has minimum elements please help

clear;clc;close; u1=1:1:3; u2=0:0.1:1.1; for jj=1:length(u1) % s1=inf; for kk=1:length(u2) x(jj,kk)=u1(j...

7 days ago | 0

| accepted

Answered

conditional statements on matrices

Where M1 and M2 are your matrices: idx1 = M1(:,2) == 0; idx2 = M2(:,2) == 0; tags = repelem([1; 2],[nnz(idx1) nnz(idx2)]); ...

conditional statements on matrices

Where M1 and M2 are your matrices: idx1 = M1(:,2) == 0; idx2 = M2(:,2) == 0; tags = repelem([1; 2],[nnz(idx1) nnz(idx2)]); ...

7 days ago | 0

| accepted

Answered

Set elements in center of matrix into NaN values

Something like this, for a single matrix: A = rand(288,96); D = 13; figure surface(A,'EdgeColor','none') axis image [M...

Set elements in center of matrix into NaN values

Something like this, for a single matrix: A = rand(288,96); D = 13; figure surface(A,'EdgeColor','none') axis image [M...

9 days ago | 0

| accepted

Answered

Generate Array of Random Values

Dims = [5 10; 10 20; 30 100]; Iter = 6; Values = rand(size(Dims,1),Iter).*(Dims(:,2)-Dims(:,1))+Dims(:,1)

Generate Array of Random Values

Dims = [5 10; 10 20; 30 100]; Iter = 6; Values = rand(size(Dims,1),Iter).*(Dims(:,2)-Dims(:,1))+Dims(:,1)

9 days ago | 0

Answered

Creating a plot that can be updated with a user slider control

Here's one way, adjust as needed: N = 25; x = 1:N; y = 1:N; z = peaks(N); idx = 1; f = figure(); ax = gca(); surf(ax,x...

Creating a plot that can be updated with a user slider control

Here's one way, adjust as needed: N = 25; x = 1:N; y = 1:N; z = peaks(N); idx = 1; f = figure(); ax = gca(); surf(ax,x...

9 days ago | 0

| accepted

Answered

how to save matlab output data in excel?

Write the transpose of the matrix (so you'll have 100000 rows and 4 columns): writematrix(Received_Signal.','ExampleMatlab....

how to save matlab output data in excel?

Write the transpose of the matrix (so you'll have 100000 rows and 4 columns): writematrix(Received_Signal.','ExampleMatlab....

10 days ago | 0

| accepted

Answered

is there a way to make the 0 x and y axis bold?

You can use xline and yline. % Given data points x = [-0.1, 0, 0.2, 0.3]; y = [5.3, 2, 3.19, 1]; % Define the range of x v...

is there a way to make the 0 x and y axis bold?

You can use xline and yline. % Given data points x = [-0.1, 0, 0.2, 0.3]; y = [5.3, 2, 3.19, 1]; % Define the range of x v...

10 days ago | 0

Answered

why the plot are all zeros?

Here a few things I notice that don't make sense to me. Coincidentally, each of them gives a condition that is always false, and...

why the plot are all zeros?

Here a few things I notice that don't make sense to me. Coincidentally, each of them gives a condition that is always false, and...

10 days ago | 0

Answered

Import .file values

unzip file.zip ls *.file str = fileread('file.file') C = regexp(str,'([^\r\n]+)\d{2}{''y'':(.+?), ''x'':(.+?), ''z'':(.+?...

Import .file values

unzip file.zip ls *.file str = fileread('file.file') C = regexp(str,'([^\r\n]+)\d{2}{''y'':(.+?), ''x'':(.+?), ''z'':(.+?...

10 days ago | 0

| accepted

Answered

Subtract first and last value of each cell array in a cell

F = @(x)x(1)-x(end); result = cellfun(F,C); where C is your cell array. Note that since the diffrerence between first and last...

Subtract first and last value of each cell array in a cell

F = @(x)x(1)-x(end); result = cellfun(F,C); where C is your cell array. Note that since the diffrerence between first and last...

11 days ago | 1

| accepted

Answered

How do I save vector values from for loop?

az = 0:90:270; rR = 0:0.1:1; % pull rR out of the loop (it never changes) N = numel(az); Lc = zeros(numel(rR),N); % make Lc...

How do I save vector values from for loop?

az = 0:90:270; rR = 0:0.1:1; % pull rR out of the loop (it never changes) N = numel(az); Lc = zeros(numel(rR),N); % make Lc...

11 days ago | 0

| accepted