Answered
How does one sum 16, 3x3 matrices as efficiently as possible?
Suppose that you happened to know that on the intel i9-12900K with two banks of DDR5 memory running at 4664 MHz, that the intern...

3 years ago | 0

Answered
I have made a simple calculator but there is an issue showing that guide error. What to do? I didn't change anything
Just before line 210, you have one of the following: line 209 might use the ... continuation operator so line 210 is expected t...

3 years ago | 0

Answered
How do I average all the values for each column in a cell array?
avg_cols = cellfun(@(x) mean(x, 1), new_mat); You only need non-uniform output if some of the outputs can be a different size o...

3 years ago | 1

Answered
How to adjust matrix
tokeep = [3:10, 13:21]; B = A(tokeep, tokeep); or B = A; B(:,11:12) = []; B(11:12,[]) = []; B(1:2,:) = []; B(:,1:2) = []; ...

3 years ago | 0

Answered
how can I set the options for Genetic Algorithm and SQP optimization? objective function and constraints are defined but I can not get the result.
It works for me. Do not expect these kinds of optimizers to output a message that says something like "Optimization terminated,...

3 years ago | 0

| accepted

Answered
i just want to check it why its not working can you try it because in my friend laptop it was working pls help
feof() only predicts end-of-file in some circumstances. You need to test ischar() of the results of fgetl() while ~feof(fid) ...

3 years ago | 0

Answered
why am I getting parse error as soon as I start loop ?
the expression for the condition of if or while must start on the same line, not the next line. Comparisons are == not =

3 years ago | 1

Answered
Why does exist('string') return 2?
In the case where NAME is the name of a built-in class, and there is a method with that name inside a @ class definition, and th...

3 years ago | 1

Answered
Error when opening merged SPM.mat file
var1= load ('SPM1.mat') var2= load ('SPM2.mat') save spm.mat var1 var2 when you load() and assign the output to a variable, ...

3 years ago | 0

Answered
Copied struct ends up in "ans" instead of new struct (within function)
I think you will find that Dependent2 is generated. After that, the end of the function is reached, and MATLAB removes all loc...

3 years ago | 0

Answered
How to find specific elements in cell array not followed by another specific element?
Assuming you used readtable() then Events = YourTable{:,1}; G = findgroups(Events); %The ids will be in sorted order.. prov...

3 years ago | 0

| accepted

Answered
Break nested loop and go to a specific line
That is not possible in MATLAB, and will never be possible in MATLAB. You need a framework something like this repeat_1 = true...

3 years ago | 0

| accepted

Answered
MATLAB Movie Error: Getting Rid of Additional Axis Label
Change figure(2); hold on; to figure(2); axis off; hold on;

3 years ago | 0

| accepted

Answered
Regexp to extract standalone numbers from string
format short S = 'X?YYx0123 [un] 21ZZz20AaaB00 A200.1 21 Xx2222 202 203.02 -204.001 A(2) B(V31) 1 01 - -' D = str2d...

3 years ago | 0

Answered
How to copy data of one or more variables from one Mat file to another Math file?
sn20_struct = load('2sn20.mat', 'one1', 'SomeArray'); one1 = sn20_struct.one1; SomeArray = sn20_struct.SomeArray; save('2sn20...

3 years ago | 0

Answered
How to get real and imaginary terms from an expression?
syms s real ws = 2 * pi * 85000 ; Lp = 27.13e-6 ; Cpp = 129.23e-9 ; Zp = s * Lp + ws * Lp * 1i ; Zpp = 1 / ( s * Cpp + ws *...

3 years ago | 0

| accepted

Answered
problem with making exe file from .m file with deploytool
See waitfor and uiwait and uiresume

3 years ago | 0

| accepted

Answered
How does matlab get the combinations that meet certain conditions in the matrix
A = [1 2 3 4 5 6 7 8 9 10]; [A1, A2, A3] = ndgrid(A); dA1 = 2*A1; mask = dA1 == A3 & dA1 == A2.*A1 + A2; solutions = [A1(mas...

3 years ago | 1

| accepted

Answered
can program tell if SISO or MIMO
In the case of transfer functions represented in tf() notation, you can look at size() of the function. This might not work if ...

3 years ago | 2

| accepted

Answered
Why are these two variables not the same value?
15 lines further down you have Max.H2_E_RT_Moment_Max_Y = max(abs(E.RT_Moment_Z_Ave)); which overwrites the previous value.

3 years ago | 0

| accepted

Answered
How to get Original image from the shuffled image without using any previous variables?
You cannot do that. Suppose that you have an image which is a simple off-center box inside background. Suppose the random sorti...

3 years ago | 0

Answered
What can we do with the thread "license-manager-error-9"?
Mathworks is actively working on figuring out the best way to clean up those kinds of threads. They need to build some tools fir...

3 years ago | 1

Answered
[Ask Help] - Erode/Erosion Matrix
a = [1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 1 1 1 0 0; 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 1 1 0 0; 1 1 1 1 1 1 0 1 1 0 0 1 0...

3 years ago | 0

Answered
How to find the input that makes the function get a specific value
You could consider minimizing @(AF) (N(GIVEN_AI,AF) - TARGET_N).^2 However, presumably "number of cycles" is an integer. If it...

3 years ago | 0

Answered
How to vectorize this piece of code and why doesn't e come out to be zero though it must come out to be zero because u and b are equal?
format long g u=[30 50 75 -30 -50 -75]; b=u; Noise=5; M = 6;%Constant1 N = 6;%Constant2 d = 0.5;%Constant3 K = len...

3 years ago | 0

Answered
Count maximum length of values < 1 in matrix
A = [0 6.858 0 0 0 0 0 0 0 0 0 0.762 5.334 2.54 0 0 0 0 0 0 0 0.762 0 0 0 0 0 0 0 0 0.508]; mask = A < 1; starts = strfind([...

3 years ago | 0

| accepted

Answered
too many arguments error using uncertainty and sensitivity code
You need to run Model_LHS which will call the other routines Parameter_settings_LHS; That is a script, and due to changes in ...

3 years ago | 0

Answered
How to visualize two images in two intersecting planes?
If you had a volume, you could use slice However if you have distinct images that you want to place into 3D, then you need to c...

3 years ago | 0

| accepted

Answered
Not enough Input Arguments
importStormData is a function that expects at least one parameter, which it refers to as filename . However when you ran the cod...

3 years ago | 0

| accepted

Answered
How to reduce decimal places displayed in symbolic matrix?
vpa(eta, DIGITS) Note that exponents might not be affected in some cases

3 years ago | 0

| accepted

Load more