Answered
how to solve this
exp(pi)*sqrt(163)

4 years ago | 0

| accepted

Answered
Why am I getting the error "not enough input arguments"?
The error message is actually saying there aren't enough inputs to the function error_disL (not fit_disL). That happens because ...

4 years ago | 0

| accepted

Answered
How to find common value from cell
cc = {[1 2 3],[1 2 4 5];[1 2 8 7 9 5],[1 3 8 7 2]}; result = cc{1}; for jj = 2:numel(cc) result = intersect(result,cc{j...

4 years ago | 0

| accepted

Answered
Finding number of points inside a 2.5*2.5 lat-lon grid box using matlab?
T=readtable('Question_data.xlsx'); res = 2.5; % grid box size % lon = -180:res:180; % lat = -90:res:90; lon = linspace(-...

4 years ago | 0

Answered
Iterating through alternating for loops
It seems like you need only one for loop, where in each iteration you add a single left stride and a single right stride. Somet...

4 years ago | 0

| accepted

Answered
Function handle in varargin not recognized
You're calling drawfunction with an expression that MATLAB tries to evaluate before sending the result of that evaluation in to ...

4 years ago | 1

Answered
How to set bottom repeating elements in matrix to NaN?
a = [ 1 2 3 2 1 3 3 1 1 3 1 2 1 2 3 3 2 1 1 2 1 2 1 3 1 2 3 1 2 1]; to_nan = cummin(a(1:end-1,:) ...

4 years ago | 1

| accepted

Answered
Having trouble importing data from file with same name in different folders
Use fullfile with the folder field of totalFiles to construct the full-path name of each file: totalFiles=dir(fullfile(mydir, '...

4 years ago | 0

| accepted

Answered
Get the positions of the first logicals (multiple sets) in an array
x = [0.5,1.6,1.5,5.2,8.5,9.3,6.3,2.2,1.9,1.8,7.4,6.4,6.5,2.3,2.4,8.5,7.6,5.3,2.0,2.4]; thresh = 5; x_log = x>thresh One way ...

4 years ago | 1

| accepted

Answered
How do I connect points in a scatter plot with lines inside an infinite loop?
You can use animatedline to do this. See the example code below. % create an animatedline speed_line = animatedline('Color','b...

4 years ago | 0

| accepted

Answered
How to label one segment of stacked bar graph?
data = [20 10; 20 20; 24 16; 24 16; 24 16; 24 16; 24 16; 20 20; 24 26; 24 46; 20 30; 24 36; 24 46]; labels = {'RC','RC','PC','P...

4 years ago | 1

| accepted

Answered
Create an array based on the values in two other arrays
A = [3; 3; NaN]; B = [1 0.25; 2 0.5; 3 0.66; 4 0.76]; C = NaN(size(A)); [ism,idx] = ismember(A,B(:,1)); C(ism) = B(idx(ism...

4 years ago | 0

| accepted

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

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

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

4 years 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', ... ...

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

4 years ago | 0

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

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

4 years ago | 1

| accepted

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

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

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

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

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

4 years 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})

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

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

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

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

4 years 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) =...

4 years ago | 1

| accepted

Load more