Answered
after running this i am getting the error - Error using diff Difference order N must be a positive integer scalar. Error in unit1 (line 14) df2a=diff(cf2a,y);
There are two functions named diff(). The one that operates on numbers such as would be in cf2a is the numeric differences funct...

3 years ago | 0

Answered
MATLAB built-in function "wrap around" an index in multiperiod planning models
Example wrapping at 7 temp = -10:10; [temp; mod(temp-1, 7)+1] The mod is the important part.

3 years ago | 0

| accepted

Answered
How to put the outputs of a for loop in a matrix ?
ivals = 4000:-500:0; numi = length(ivals); V_sink_with_cd = zeros(numi, 1); V_sink_without_cd = zeros(numi, 1); for iidx =...

3 years ago | 0

| accepted

Answered
How to put subscripts in this example?
That feature is only available in the Live Editor.

3 years ago | 0

Answered
Particle swarm UseParallel issur
That can happen if the fit function depends upon global variables, or upon persistent variables that are established beforehand ...

3 years ago | 0

Answered
How to recover an unsaved "untitled2.m" script after computer crashed
Look in the location indicated by the command tempdir . However, in practice that directory is used for MATLAB mostly to store...

3 years ago | 0

Answered
How can I make a colo figure from a string array?
First you need to scrape a bunch of tables such as https://www.farb-tabelle.de/en/table-of-color.htm and https://cloford.com/res...

3 years ago | 0

Answered
Converting a .mat file with multiple variables from v5 to v7
The file was saved in v5 format, which doesn't seem to be supported Supported by what? And what are you looking at to see that ...

3 years ago | 0

| accepted

Answered
Scatter Plotting With Custom Markers?
Unfortunately, there is no support for custom markers in any Mathworks function that I can think of. I seem to recall some File...

3 years ago | 0

| accepted

Answered
I was trying to use uvector for defining a unit vector, but it gives an error :Unrecognized function or variable 'uvector'.
uvector is part of https://www.mathworks.com/matlabcentral/fileexchange/39160-optimal-impulsive-orbital-transfer and https://ww...

3 years ago | 0

Answered
Subs Function not working properly
syms theta(t) R_C_m R_C m_C I_C syms phi(t) R_L_m R_L m_L I_L theta and phi are symfun, not just plain sym Veloce = subs(rh...

3 years ago | 0

| accepted

Answered
symsum does not work with symprod
syms j k double(symsum((-symprod((j+0.3-1)/(j), j, 1,k))^2, k, 2, Inf)) So it works in current releases. I am checking back t...

3 years ago | 0

| accepted

Answered
How to optimize this code for running time?
HcoI3_DC = HcoI3_DC + (M-l+2)*(M-l+1)/2*1^(-(l-1)); When l is finite, then 1^(-(l-1)) is going to be 1, even if -(l-1) is n...

3 years ago | 0

Answered
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
The problem is inside CR3BP_NewtonMethod.m at line 31 -- not inside the NewtonsMethod_FindGEOIntersect script that you showed us...

3 years ago | 0

Answered
I have a .xls file that I have imported and I am needing to remove the min number from each row. going down by each row.
[~, minidx] = min(B, 1); Now you want to delete row minidx(1), column 1, row minidx(2), column 2, row minidx(3), column 3, and ...

3 years ago | 0

| accepted

Answered
How to solve an equation contains norminv?
syms x eqn = 10*log10(10.^(0.1*(-sqrt(2)*erfcinv(2*x)*7.6 + 9.88)) + 10.^(0.1*(-sqrt(2)*erfcinv(2*x)*6.5 + 12.1)) + 10.^(-0.3))...

3 years ago | 0

| accepted

Answered
Errors related to macOS version
It is difficult to be certain without seeing the code, but my first guess would be: that the code has a call similar to [filen...

3 years ago | 0

| accepted

Answered
How can i rewrite this logic for n elements?
https://www.mathworks.com/help/deeplearning/ref/onehotdecode.html Or... Dvals = [D1, D2, D3, D4, D5, D6, D7, D8, D9, D10]; P...

3 years ago | 0

| accepted

Answered
What is the difference between these two reading table file funciton?
If you have a particular variable (column) that contains some text, then do you want the text to be represented as a cell array ...

3 years ago | 0

Answered
How to use a structure value as an index
XLON = cellfun(@(IND) lon_rho2(IND), D, 'uniform', 0);

3 years ago | 0

Answered
invalid setting for input port dimensions of 'untitled/Demux'. The dimensions are being set to 1. This is not valid because the total number of input and output not equal
Your Step1 block is emitting a scalar double. You are feeding that scalar double into a DEMUX block that has been configured wit...

3 years ago | 1

Answered
I get different solutions from ODE45
Plotting the whole line in red if the voltage peak for the line is above 0 is what the question asks. It does not ask for the pa...

3 years ago | 0

Answered
how to find location of nans in a matrix
[r, c] = find(isnan(YourMatrix)) ;

3 years ago | 0

| accepted

Answered
How do I fix my array indices? Error says must be positive or logical values.
thisDistance = round(sqrt((row-y)^2 + (column-x)^2)); Your x and y are 300 x 300 arrays, so (row-y) returns an array ...

3 years ago | 0

Answered
contour for scatter data
https://www.mathworks.com/matlabcentral/fileexchange/38858-contour-plot-for-scattered-data

3 years ago | 0

Answered
Unpack structure, only some fields
You are expecting that your function will be able to look at the names of the output variables in the caller, and figure out fro...

3 years ago | 0

| accepted

Answered
seting default property values for uifigure graphics
You need to set against ['default' classname PropertyName] and it must be a property that exists in the class. You cannot say...

3 years ago | 0

Answered
Two accounts simultaneously on the same computer?
Yes, for all license types *except* for Dedicated Host licenses. (In practice Dedicated Host will probably run provided that ...

3 years ago | 0

Answered
I am trying to rename a matlab file using this code I was given, I having "brace indexing is not supported variables" I would replace
[MAT_file,PathName] = uigetfile('*.mat', 'Multiselect', 'on'); When Multiselect is off then uigetfile() returns: numeric 0...

3 years ago | 0

Answered
MATLAB not sorting the text files in order.
MATLAB is sorting correctly. The first character is compared before any other characters are compared, so all entries starting ...

3 years ago | 0

Load more