Answered
Need help with a long while loop
load('archive'); loads *every* variable in archive.mat overwriting existing variables of the same name. One of the variable...

3 years ago | 2

| accepted

Answered
lsqcurvefit "assigning the function output to this expression is not supported"
[x,resnorm,~exitflag,output] = lsqcurvefit(F,x0,newX,newY) Assignment permits a few different forms: indexed_variable = expres...

3 years ago | 0

Answered
Error using sum Dimension argument must be a positive integer scalar within indexing range.
2^N-i is 2^11-6 = 2048 - 6 = 2042. ones(2042) is a 2D array that is 2042 x 2042 that is all ones. You are passing that 2042 by 2...

3 years ago | 1

Answered
Automatic numbering for a cleaner code
ic = num2cell(initvals); [A, B, C, D etc] = deal(ic{:}) ;

3 years ago | 0

| accepted

Answered
How do I overwrite part of a .tsv file?
dlmwrite always overwrites all of the text file unless -append is used. There is no way to get dlmwrite to overwrite part of a t...

3 years ago | 0

Answered
MAP AND GRAPHS IN GUI DOESN'T WORK
geoplot can only draw in Geographic Axes objects, but your other graphics are Cartesian axes objects.

3 years ago | 0

Answered
What is the difference between "any" and "all" function?
any: at least one of the inputs is non-zero all: every input is non-zero Mathematically, all(x) works out the same as ~any...

3 years ago | 1

Answered
Why do I receive License Manager Error -9? I think I have a valid license number
It has nothing to do with license number. The current installation is activated against a username that is not the same as the u...

3 years ago | 0

Answered
Error on transmitting image simulink [MODEL INCLUDED]
Your image is rgb but the downstream cannot handle rgb. You will need to convert to gray or convert to pseudocolor or reshape to...

3 years ago | 0

| accepted

Answered
Can I run all cases of switch ? if not, is there another way ?
https://www.mathworks.com/matlabcentral/answers/1903645-how-can-i-randomly-excuted-for-loops-inside-main-for-loop-instead-of-run...

3 years ago | 0

Answered
Get calculated output arguments when an error is thrown
No, the function would have to be designed to use try/catch itself. Once an error is thrown and the function has returned all of...

3 years ago | 0

| accepted

Answered
R2022b Update 4 offline update installer?
The offline installer currently has a bug that can corrupt matlab installations.

3 years ago | 1

| accepted

Answered
How to Identify generated MATLAB instances using !matlab &
if you are using !matlab& then you must be using Linux or MacOS, with Linux being more likely. You can use system('ps') with ...

3 years ago | 0

Answered
Solve two trigonometric equations of the first degree in two unknowns
create two equations using "syms" and == then sol=solve(eq1, eq2, [X Y], 'maxdegree', 4) to get the exact answers. ...

3 years ago | 0

Answered
Adding strings in simulink
you are resizing the string. string literals do not appear to be dynamically sized. Use a different variable name the first t...

3 years ago | 0

Answered
Keep getting a blank graph
You use linear interpolation inside your ode function. Linear interpolation has discontinuous derivatives. The mathematics of Ru...

3 years ago | 1

Answered
How can I use scatteredInterpolant function to interpolate between a bunch of scatter points within the map? (without using meshgrid)?)
Yes. Follow the steps I suggested in your previous question to turn the shapes into a a mask. Then find() on the mask to get the...

3 years ago | 0

Answered
the code doesn't exit when we apply the swift waveform
you appear to have code that should iterate two million times, but somewhere in the calculation instead of using a vector indexe...

3 years ago | 0

Answered
Heat Transfer: Solve using "relaxation" method while storing residuals and temperatures in arrays
if (find(max(R)) == 1) R is a vector. max(R) is a scalar value. find() of a scalar will be 1 if the scalar is non-nan and...

3 years ago | 0

| accepted

Answered
how do i use sqrt when trying to code a math function
sqrt(100^2+(.01x-(100/x))^2) ^^ MATLAB has absolutely no implied multiplication. .01x is a syntax error, not 0....

3 years ago | 0

Answered
Cross vectors of different sizes
h = randi([-5 5], 3001, 3); k = [0 1 1]; output = sum(h .* k,2); whos output output(1:2) h(1:2,:)

3 years ago | 0

Answered
Matlab Transfer function multiple single s terms
syms G C_1 R_2 C_2 R_1 s R_3 R_4 G = (R_3 + R_4)/R_3 vratio = G*s^2/ ( s^2 + s * (1/(C_1*R_2) + 1/(C_2*R_2) + 1/(C_1*R_1)*(1-G...

3 years ago | 0

Answered
MATLAB CODE FOR NEXT PAGE IN GUI
In every case in which you construct a graphics object, you should specify the parent object to insert the new object into, if p...

3 years ago | 0

Answered
Read multiple .mat files and process them
The output of load is always a struct that contains one field for each variable that was loaded. Your second code has the right ...

3 years ago | 0

Answered
Default position of comparison window when I use the Compare button in the Editor is off screen. Can it be changed?
Can you give me a command to enter in my start.m file to change the default position? No, we cannot give you a command for that...

3 years ago | 0

| accepted

Answered
Why do I get "Array indices must be positive integers or logical values" error?
K(:,i,j) = floor(k.*mod((u(:,j) + (d./2).*X(:,i)),1)); something mod 1 can give a result of 0. k times 0 will be 0. So K can co...

3 years ago | 0

| accepted

Answered
To change the output dimension of a block
If you need groups of four sensor readings to become the input, then use a buffer block. However I *suspect* that instead you...

3 years ago | 0

Answered
How to perform derivative of a random signal without finite difference schemes?
https://math.mit.edu/~stevenj/fft-deriv.pdf You can create blocks of signal, perhaps perform some windowing function on the b...

3 years ago | 0

Answered
How to output a sym to a msgbox
char() of a sym will produce *a* representation of the symbolic expression. Be aware that the representation is intended to be h...

3 years ago | 0

Answered
Index exceeds the number of array elements. Index must not exceed 2.
soln = ode45(@problem03ODEFunction,[0 35],[-10 0],opts); That is time span 0 to 35, together with two initial conditions.

3 years ago | 0

Load more