Answered
subtitle on a 2x2 grid plot using sgtitle?
folderName = 'MATLAB folder'; fileName = 'test.m'; sgt = sgtitle({['{\bf\fontsize{14}' folderName '}'],fileName});

10 days ago | 0

| accepted

Answered
Complex outcome loop change to zeros
"The V_2 plot should give a zero velocity when imaginary number outcome occurs." You can replace complex elements of V_2 with 0...

10 days ago | 0

| accepted

Answered
I want to read data and variable name from txt file
For a text file that looks like that, readtable does essentially the right thing: T = readtable('input_file_test.txt'); T.Pr...

10 days ago | 0

| accepted

Answered
Is there a function that tells me the elapsed time as the elapsed time continues to run?
figure( ... 'Name','Stopwatch', ... 'NumberTitle','off', ... 'Menubar','none', ... 'Toolbar','none', ... ...

11 days ago | 0

Answered
Attempting to Plot In A Specific Range
You will need a vector, the same length as y, containing an x value for each y value. Let's say you have that vector and it's c...

11 days ago | 0

Answered
Converting from comma delimiter to semicolon
type test.csv % initial comma-delimited file T = readtable('test.csv'); ...

11 days ago | 1

Answered
Elementwise calculations when making a new Table column
Protocol = ["A" "A" "B" "C"]'; Operator = [1 2 2 1]'; Value1 =[4 3 3 8]'; Stats3 = table(Protocol,Operator,Value1) If limits...

11 days ago | 1

| accepted

Answered
I want to create cell arrays containing all zero elements in them.
C = repmat({zeros(2600,6)},1,20)

11 days ago | 0

| accepted

Answered
vertical or horizontal array random combination in single array
A={[12;13] ;[1,5] ;[5;6;7]; [1,3,5,4]}; % make each element of A a row vector A = cellfun(@(x)x(:).',A,'UniformOutput',false...

11 days ago | 1

Answered
how to plot separately ..plots getting replaced?
You had some syntax errors in constructing your file names, and a missing argument in your calls to figureplots*. Check the cod...

11 days ago | 0

Answered
Add a specific line or point in boxplots
Here's how you can set the value of those median lines. In this example I'll change them from the median MPG to the mean MPG (y...

11 days ago | 0

| accepted

Answered
trying to output the indeces for plus minus 5 from each value in an array
If you compare a column vector to a row vector, you get a matrix that is the result of comparing each element of one vector to a...

11 days ago | 0

| accepted

Answered
Multiple Maximas in multiple matrices
% data matrix1=[10:1:15]; matrix2=[15:1:25]; matrix3=[25:1:35]; %max maxValue = cellfun(@max,{matrix1 matrix2 matrix3})

12 days ago | 1

| accepted

Answered
Issue with Plotting Data set based on Checkboxes in MATLAB App Designer
I guess I would get the data to plot based on the selected checkboxes in app.UITable directly, without using app.SelectedDevices...

12 days ago | 1

| accepted

Answered
Extract a column from cell array containing arrays
% 400x30 cell of 1x3 random vectors: C = reshape(num2cell(rand(400*30,3),2),400,[]) % first element of the vector in each cell...

12 days ago | 1

| accepted

Answered
Why I cannot see any result on my graph
Instead of this: plot(i,SXsol(i)) try this: fplot(SXsol,[0 300]) or this: t_plot = 0:10:300; plot(t_plot,SXsol(t_plot))

12 days ago | 1

| accepted

Answered
Select columns of a table using matching column names
v = {'Var1' 'Var3'} T = table([1;2;3],[4;5;6],[7;8;9]) % a table of the selected columns of T: new_T = T(:,v) % or, the data...

12 days ago | 1

| accepted

Answered
Remove Terms in Complex Valued Data That Has Only Real or Imaginary Part
load LR disp(LR); One way: % remove elements of LR whose real part is 0 or imaginary part is 0 LR(real(LR) == 0 | imag(LR) =...

12 days ago | 1

| accepted

Answered
Why am I getting error "Vectors must be the same length" although they are of same length?
load('subject_data.mat') disp(subject_data) % There are 2 Trial40's in the table: find(subject_data.trialname == 'Trial40') ...

12 days ago | 1

| accepted

Answered
Using if-else statement to determine which value to input into function
t = max(samplegrades(:,2),samplegrades(:,3)) The if doesn't work as you expect because, when using an array condition in an if ...

13 days ago | 0

| accepted

Answered
Can't get matlab to run a .exe file...
Try putting double-quotes around the paths contained in exec_path (i.e., the path to the exe and the directory sent to the exe a...

13 days ago | 0

Answered
Grouping users into 3 groups using for loop and if statements
It seems like you should not be using two loops. That'll do the counting for every combination of i and k. Instead it seems like...

13 days ago | 1

| accepted

Answered
Trying to sort unique values in cell array based on different column
test = {'Type1', 'Type1', 'Type2', 'Type2', 'Type2', 'Type3', 'Type4', 'Type4', 'Type4', 'Type4', 'Type4', 'Type5', 'Type5', 'Ty...

13 days ago | 0

| accepted

Answered
How can I extract a field from a matrix of structs, preserving the shape of the matrix?
% create a 2d array of structs S: S = struct( ... 'field1',{0.96 0.33 0.61; 0.11 0.26 0.93}, ... 'field2',{0.55 0.16 ...

13 days ago | 0

Answered
Remove the duplicated vector in the array
A = [1 3; 1 4; 1 3; 1 4; 2 3; 3 4; 3 4; 3 5; 4 5]; new_A = unique(A,'rows')

13 days ago | 1

| accepted

Answered
how can i create a column vector with specific values?
vec = [0; (63:-1:1).']

14 days ago | 0

| accepted

Answered
why i can't delete a surface 3d plot (fsurf i mean) whereas i can delete a plot. If it can be, how can i do that
In order for the surface to be accessible in function calls subsequent to the one in which it is created (e.g., to delete the su...

14 days ago | 0

Answered
How to use arguments of other m-file in another m-file?
% get the outputs from A: [a1,a2,a3] = A(5); % use them as inputs in B: result = B(a1,a2,a3) function [out1,out2,out3] =...

14 days ago | 0

Answered
Getting the ratio of consecutive links in network using loop.
A = 1:9; % unused B = [2 10 5 8 12 6 14 6 2]; B_ratio = [NaN B(2:end)./B(1:end-1)] % no loop necessary

14 days ago | 0

| accepted

Answered
Create a matrix with one vector
v=[1,2,3,4]; N = numel(v); idx = max(1:N,(1:N).'); M = v(idx)

14 days ago | 0

| accepted

Load more