Answered

Image and two bubblecharts in one plot

copyobj copies graphics object(s) and their descendants, so when you call copyobj after creating the image, you get a copy of th...

Image and two bubblecharts in one plot

copyobj copies graphics object(s) and their descendants, so when you call copyobj after creating the image, you get a copy of th...

13 dagen ago | 0

| accepted

Answered

I need to create a Table. How do I create the output of the table values of a function?

theta = 0:15:90; m = 55:10:75; uitable( ... 'ColumnName',m, ... 'RowName',theta, ... 'Data',m+sind(theta).');...

I need to create a Table. How do I create the output of the table values of a function?

theta = 0:15:90; m = 55:10:75; uitable( ... 'ColumnName',m, ... 'RowName',theta, ... 'Data',m+sind(theta).');...

13 dagen ago | 1

| accepted

Answered

Editing text file with Matlab.Sort with an ascending order.

% read the file: fid = fopen('velocity-data-empty-domain-urban-configuration.txt'); data = fread(fid,'*char').'; fclose(fid);...

Editing text file with Matlab.Sort with an ascending order.

% read the file: fid = fopen('velocity-data-empty-domain-urban-configuration.txt'); data = fread(fid,'*char').'; fclose(fid);...

13 dagen ago | 1

| accepted

Answered

title subplots within a for loop

How about if you try title(ll + "(m)")

title subplots within a for loop

How about if you try title(ll + "(m)")

13 dagen ago | 0

| accepted

Answered

How to fix the plot box size independetly of the number of digits of the tick labels

This doesn't appear to happen when using subplot or tiledlayout: figure subplot(2,1,1) plot(0:10,0:10) subplot(2,1,2) plot(...

How to fix the plot box size independetly of the number of digits of the tick labels

This doesn't appear to happen when using subplot or tiledlayout: figure subplot(2,1,1) plot(0:10,0:10) subplot(2,1,2) plot(...

13 dagen ago | 0

Answered

How to compare part of a table row with other rows?

T = [ 5 5 5 5 2 0 0 0 -45 0 15 5 5 5 2 0 0 0 -4...

How to compare part of a table row with other rows?

T = [ 5 5 5 5 2 0 0 0 -45 0 15 5 5 5 2 0 0 0 -4...

13 dagen ago | 0

| accepted

Answered

How to remove data noise through averaging adjacent elements in a data set.

x = 1:10 One way: xm = movmean(x,2) xm = xm(2:2:end) Another way: xm = mean(reshape(x,2,[]),1)

How to remove data noise through averaging adjacent elements in a data set.

x = 1:10 One way: xm = movmean(x,2) xm = xm(2:2:end) Another way: xm = mean(reshape(x,2,[]),1)

13 dagen ago | 0

Answered

How to save/load current MATLAB workspace in .mat file from app designer

To save your MATLAB (i.e., base) workspace to a mat file from within an app: evalin('base',['save(''' name_file '.mat'');']); ...

How to save/load current MATLAB workspace in .mat file from app designer

To save your MATLAB (i.e., base) workspace to a mat file from within an app: evalin('base',['save(''' name_file '.mat'');']); ...

13 dagen ago | 0

Answered

How to use subplot in a UIFIGURE?

At first I get an error: Error using subplot Adding subplots to a container with the 'AutoResizeChildren' property set to 'on'...

How to use subplot in a UIFIGURE?

At first I get an error: Error using subplot Adding subplots to a container with the 'AutoResizeChildren' property set to 'on'...

14 dagen ago | 0

Answered

Getting Output Matrix from GUIDE

Maybe use a uitable rather than an edit box.

Getting Output Matrix from GUIDE

Maybe use a uitable rather than an edit box.

14 dagen ago | 0

Answered

How do I change Array element with another array element?

A = [0 0 0 0]; B = [1 1 0 0]; To replace each element of A with the corresponding element of B: A = B; % since A and B are th...

How do I change Array element with another array element?

A = [0 0 0 0]; B = [1 1 0 0]; To replace each element of A with the corresponding element of B: A = B; % since A and B are th...

14 dagen ago | 0

Answered

How to use for loops for splitting a domain in MatLab?

increments = [0.5 0.1 0.05 0.01]; for ii = increments x_1 = 0:ii:10; y_1 = sin(x_1); hold on; plot(...

How to use for loops for splitting a domain in MatLab?

increments = [0.5 0.1 0.05 0.01]; for ii = increments x_1 = 0:ii:10; y_1 = sin(x_1); hold on; plot(...

15 dagen ago | 1

| accepted

Answered

Making a horizontal line of predefined length for a plot

One way is to give plot the two endpoints of the line segment, i.e.: plot([0 2],[2 2]) % (0,2) and (2,2) Another way - if you ...

Making a horizontal line of predefined length for a plot

One way is to give plot the two endpoints of the line segment, i.e.: plot([0 2],[2 2]) % (0,2) and (2,2) Another way - if you ...

15 dagen ago | 0

| accepted

Answered

Solving equation with two for loops

S1 is calculated for a given i and j, so it is not correct to index it with i and j on the next line. That is, use S1==0 instea...

Solving equation with two for loops

S1 is calculated for a given i and j, so it is not correct to index it with i and j on the next line. That is, use S1==0 instea...

15 dagen ago | 1

Answered

please help me with the code for table 13.2 of example 13.6 in (attached file) as it is not providing me the correct + all values of the equation.

The main thing you're missing is that the equations (e.g., Eq 13-22 and 13-23) are expressing the result at time k+1 in terms of...

please help me with the code for table 13.2 of example 13.6 in (attached file) as it is not providing me the correct + all values of the equation.

The main thing you're missing is that the equations (e.g., Eq 13-22 and 13-23) are expressing the result at time k+1 in terms of...

15 dagen ago | 1

| accepted

Answered

Extract/read data from a matrix of a specific column that starts from a specific row and reads the rest of the rows below it

You've almost got it already. To include row 11: time = matrix(11:end,1); To exclude row 11: time = matrix(12:end,1);

Extract/read data from a matrix of a specific column that starts from a specific row and reads the rest of the rows below it

You've almost got it already. To include row 11: time = matrix(11:end,1); To exclude row 11: time = matrix(12:end,1);

16 dagen ago | 0

Answered

how to find the Euclidean distance between the first and last columns in matrix?

norm(A(:,1)-A(:,end))

how to find the Euclidean distance between the first and last columns in matrix?

norm(A(:,1)-A(:,end))

18 dagen ago | 0

Answered

Loop for increment number in file name

Here's one way to generate those file names: for i = 1:10 current_file_name = sprintf('AccelGyro_Gait_%02d',i) % then...

Loop for increment number in file name

Here's one way to generate those file names: for i = 1:10 current_file_name = sprintf('AccelGyro_Gait_%02d',i) % then...

18 dagen ago | 0

Answered

"Error using textscan Invalid file identifier. Use fopen to generate a valid file identifier." - why am i getting this error?

Most likely you get that error because the file ['data/' allHurricanesFileName] does not exist. To find out for sure, you can ...

"Error using textscan Invalid file identifier. Use fopen to generate a valid file identifier." - why am i getting this error?

Most likely you get that error because the file ['data/' allHurricanesFileName] does not exist. To find out for sure, you can ...

18 dagen ago | 0

Answered

A'(' might be missing a closing ')' causing invalid syntax at the end of line

You are missing the ellipses (i.e., "...") at the end of the first line where den(cnt) is defined. den(cnt) = s^2*(s^4*(m1*m2*m...

A'(' might be missing a closing ')' causing invalid syntax at the end of line

You are missing the ellipses (i.e., "...") at the end of the first line where den(cnt) is defined. den(cnt) = s^2*(s^4*(m1*m2*m...

18 dagen ago | 0

Answered

how to find the number of negative cells in matrix ?

A = randn(5) % 5-by-5 random matrix nnz(A < 0) % number of elements of A that are < 0

how to find the number of negative cells in matrix ?

A = randn(5) % 5-by-5 random matrix nnz(A < 0) % number of elements of A that are < 0

18 dagen ago | 1

| accepted

Answered

How do I get my variable to list in different columns of the ASCII file I am saving them to?

final = [x, y, vel]; save('ProjectileKinematics.dat', 'final', '-ascii')

How do I get my variable to list in different columns of the ASCII file I am saving them to?

final = [x, y, vel]; save('ProjectileKinematics.dat', 'final', '-ascii')

18 dagen ago | 0

Answered

change only some cell values to a value of 1

Yes, you can use cellfun with a helper function: C = { [0,241,638,168] [204,181,382,287;56,0,185,244] [0,59,574,...

change only some cell values to a value of 1

Yes, you can use cellfun with a helper function: C = { [0,241,638,168] [204,181,382,287;56,0,185,244] [0,59,574,...

18 dagen ago | 0

| accepted

Answered

How to colour each individual bar with a different colour?

CoverageArea = [101.1303,0,114.9316,45.2112,116.5973,95.8953]; h = bar(CoverageArea); ylabel('Coverage area (m²)'); xticklabe...

How to colour each individual bar with a different colour?

CoverageArea = [101.1303,0,114.9316,45.2112,116.5973,95.8953]; h = bar(CoverageArea); ylabel('Coverage area (m²)'); xticklabe...

19 dagen ago | 0

| accepted

Answered

How to plot data from cells?

Here's one way: load('data_conditions.mat') data_oROI for ii = 1:numel(data_oROI) subplot(2,2,ii) plot(squeeze(data...

How to plot data from cells?

Here's one way: load('data_conditions.mat') data_oROI for ii = 1:numel(data_oROI) subplot(2,2,ii) plot(squeeze(data...

19 dagen ago | 1

Answered

Label a plot as contour function does

Sounds like you want to use text: x = 1:500 ; y = 150 + 100*sin(x/100) ; plot(x,y) text(50*pi,250,'1', ... 'Backgroun...

Label a plot as contour function does

Sounds like you want to use text: x = 1:500 ; y = 150 + 100*sin(x/100) ; plot(x,y) text(50*pi,250,'1', ... 'Backgroun...

19 dagen ago | 1

| accepted

Answered

Please help fix the syntax for my plot.

The XData of the line you plot is Example(:,5), which is in the 800-900 range, but then you set the XLim of the axes to [0 10]. ...

Please help fix the syntax for my plot.

The XData of the line you plot is Example(:,5), which is in the 800-900 range, but then you set the XLim of the axes to [0 10]. ...

20 dagen ago | 0

Answered

Vectorisation for nested for loops in Piecewise Linear Transformation

transformed = original; idx = original < x1; transformed(idx) = m1 * original(idx); idx = original >= x1 & original < x2;...

Vectorisation for nested for loops in Piecewise Linear Transformation

transformed = original; idx = original < x1; transformed(idx) = m1 * original(idx); idx = original >= x1 & original < x2;...

20 dagen ago | 0

| accepted

Answered

How to plot x-z plot which is varying in time (a dynamic plot)?

Something like this might be a start, if I understand what you want to do: function ionGUI() t = readtable('SampleData.txt')...

How to plot x-z plot which is varying in time (a dynamic plot)?

Something like this might be a start, if I understand what you want to do: function ionGUI() t = readtable('SampleData.txt')...

20 dagen ago | 1

| accepted