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

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

3 years 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)

3 years 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'');']); ...

3 years 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'...

3 years ago | 1

Answered
Getting Output Matrix from GUIDE
Maybe use a uitable rather than an edit box.

3 years ago | 0

| accepted

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

3 years 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(...

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

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

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

3 years 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);

3 years ago | 0

| accepted

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

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

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

3 years ago | 0

| accepted

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

3 years 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')

3 years 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,...

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

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

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

3 years 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]. ...

3 years 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;...

3 years 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')...

3 years ago | 1

| accepted

Answered
How to plot validation and loss in the same curve?
yyaxis may work.

3 years ago | 0

Answered
Unable to perform assignment because the size of the left side is 1-by-5 and the size of the right side is 1-by-6
You can append an extra column (of NaN's, say) to A, whenever you increase ncols by 1. That will avoid the error, but I'm not su...

3 years ago | 0

Answered
Delete items from array and split it up into new arrays
array = [-0.0016 -0.0017 0.1746 0.1834 -0.0017 -0.0018 0.1567 0.1456 0.1744 -0.0018 -0.0017 0.1243 0.1456]; is_negative = arr...

3 years ago | 0

Answered
How to solve ''Not enough input arguments'' error?
You'll get that error if you run the function by clicking the green Run arrow in the editor. The reason is that this function ta...

3 years ago | 0

Answered
Conversion of equation to matlab
Original expression: WP_ROC = 1./((ROC/np)+(sqrt((2./(0.0028*sqrt((3*Cdo./K)*WSrange)*(1.155./(LDratio*np))))))); % ...

3 years ago | 0

Load more