Answered
Omit marker NaN data
a = struct('LANK',[NaN(260,3); rand(558,3)],'LGTRO',[NaN(260,3); rand(558,3)]) f = fieldnames(a); % go through each field of s...

4 years ago | 0

Answered
Matlab turns char into double on cluster.
It may be that the mat file you load contains a variable called dtaset_id, which is a double. When you load the mat file that va...

4 years ago | 1

| accepted

Answered
Subscripted assignment between dissimilar structures.
It seems likely that wellSol is missing some field that is assigned to ws in your code. For instance, suppose that wellSol does...

4 years ago | 0

Answered
Initial values on the plot
Here's an approach that may work for you (an approach taken from this recent answer): % make up some X: X = [-22.5 -1.5 2.00 -...

4 years ago | 0

Answered
saving all open figures in script as .png file in a folder
It may be that the .png files are being saved in the current working directory (because FolderName (G:\Image proccessing\test) i...

4 years ago | 0

Answered
search for a value in one matrix in another matrix
% Matrix A: A = [16 14 12 10 18]; % Matrix B: B = [2; 3; 5; 4; 1]; % new matrix : new_matrix = [B A(B).']

4 years ago | 0

| accepted

Answered
find matrix values ​​and print to another matrix
You can use ismember() with its second output argument: https://www.mathworks.com/help/matlab/ref/double.ismember.html#d123e786...

4 years ago | 1

| accepted

Answered
How to use MATLAB RGB triplets and hexadecimal color codes for a custom plots?
The problem is not the colors; the problem is trying to specify line properties for multiple lines in one call to plot(). Line ...

4 years ago | 2

Answered
take a sum in a matrix and print it on a different row
If you are starting with an Nx3 matrix of (process, start, end) times: % initial matrix: % process start end times = [2 0 ...

4 years ago | 0

Answered
How to append a vector to a cell array?
% A cell array of vectors, C: C = {[1 2 3]; [1 2 3 4 5]; [1; 2; 3; 4; 5; 6]} % Append a new vector to the end of C: new_vecto...

4 years ago | 1

Answered
Setting a limit on decimal points for a bar graph
You can use sprintf('%.2f',__) or sprintfc('%.2f',__), as in: CO = 4*rand(1,7); figure3 = figure; b = bar(CO,'FaceColor',[0.4...

4 years ago | 2

| accepted

Answered
sine waveform with frequency and samples
Here's how you can do that. This plot is zoomed in, so you can see it % frequency = 100 Hz = 100 cycles/second % sampling rate...

4 years ago | 0

Answered
How to bold in a sprintf function?
m = 2; b = 1; % set up normal and bold strings, for comparison: str_normal = sprintf('Y = %.2f X + %.2f',m,b) % use \\ to "e...

4 years ago | 2

Answered
making a residual graph with a function as a base line
H=[2.5;3.7;4.5;5.3;6.5;7.5;8.5;10.5;12.5;14.5;17.5;20.5;23.5;26.5]; g=[8.38;10.08;11.34;12.183;14.1;13.46;14.5;16.55;18.06;19.0...

4 years ago | 0

| accepted

Answered
If condition: "in each row of a matrix one element is zero and the other one is not zero"
You can use all() A = [ 1 0 0 9 12 0 0 2 0 3]; if all(sum(A==0,2) == 1) disp('in each row one ...

4 years ago | 0

| accepted

Answered
How do you move the location of labels on a stacked bar graph?
I'm not sure how it will look with the actual data you have, but you can try this: CO2_Pump = rand(7,3); % random data figur...

4 years ago | 1

| accepted

Answered
How to fill multiple matrixes with the position of specific data points within a matrix of years with a loop?
All the cells in Positions have the same numbers because Positions{k} is overwritten for each ii, so you end up with just the in...

4 years ago | 0

| accepted

Answered
find and print values ​​from matrix
% given matrix with three rows: M = [ ... 1 2 3 4 5 6; ... 3 1 2 2 3 1; ... 2 3 3 1 ...

4 years ago | 0

| accepted

Answered
What should I do to solve the problem that the content of the text added in the matlab drawing window is outside of the figure?
You can adjust the axes and text Positions after everything else. See the bottom of the code below. % made up data: data_all =...

4 years ago | 1

| accepted

Answered
Plotting multiple files, excel and txt
% the txt files seem to be read just fine using readmatrix(): meiv2 = readmatrix('meiv2.data.txt'); darwin = readmatrix('darwi...

4 years ago | 0

| accepted

Answered
How to produce a grouped errorbars?
Maybe something like this: load('mean.mat') load('std.mat') mean = mean.'; figure(); ax = gca(); hold on % to be ad...

4 years ago | 1

| accepted

Answered
Insufficient input arguments. continues to come out. Help
Try changing this: [t , y]= ode23(odefun, tspan, y); to this: [t , y]= ode23(@odefun, tspan, y);

4 years ago | 0

Answered
read the values of a 3 x 3 matrix from the user, then output
% create a 3*3 matrix numRow = 3; numCol = 3; matrix = []; % create an empty to store the elements for row = 1:numRow ...

4 years ago | 0

| accepted

Answered
calculate the number of odd fence values instead of printing them
if (mod(A(i,j),2)~= 0) Use A(i,j) instead of A(i)

4 years ago | 1

| accepted

Answered
How to interchange elements of an array?
X = [ 4 2 3 6 5 1]; x1 = [2 3 1 2]; Xnew = X; for ii = 1:numel(x1) Xnew([ii x1(ii)]) = Xnew([x1(i...

4 years ago | 1

| accepted

Answered
Index in position 2 exceeds array bounds. Index must not exceed 1.
Do you have a variable called zeros in your workspace? To find out, do whos('zeros') If there is one, remove it with clear('zero...

4 years ago | 1

| accepted

Answered
how to store values in csv format?
Maybe try it without the '-append' option (and ',' is the default delimiter, so you don't need to specify it [and 'delimiter' ne...

4 years ago | 0

| accepted

Answered
I would to get my equation to iterate 15 times
format long % Given Temperture and Pressure T = 308.15; % K - Given Temperture P = 101.325 ; % kPa - Pressure % Standa...

4 years ago | 0

| accepted

Answered
How can I plot various polynomials along with some coordinate pairs in the same graph?
I imagine you said the graph goes crazy because the points where the first polynomial is evaluated (i.e., (lx, ly)) was plotted ...

4 years ago | 0

| accepted

Answered
How would you read a specific channel in a tdms file in matlab?
If you might have any number of elements of the struct array data.Data.MeasuredData whose 'Name' field is 'Synchronous/Air Manif...

4 years ago | 0

| accepted

Load more