Answered
Why am i getting only one value and the rest is NaN
Use the debugger to find the source of the NaN values, see: <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process...

8 years ago | 0

Answered
Vectorize a doble loop for
Assuming that |omega| is a logical matrix (please post what the inputs are, such that the readers do not have to guess the detai...

8 years ago | 0

| accepted

Answered
using ODE45 to solve simultaneously independent ODE's vs. calling the function twice - different results...
This is a problem of the accuracy only. Decrease the tolerance to get equivalent trajectories for the simultaneous and separate ...

8 years ago | 0

| accepted

Answered
Matlabs offer a free trial, take your details, then say you dont qualify for a trial... is it a scam?
No, it is not a scam. Of course MathWorks needs your details to decide, if you are qualified to get a free trial. Qualifying wit...

8 years ago | 0

Answered
How do I delete my account??
Do you mean the community account or your Matlab account? In both cases contact the Matlab support team: Use the <https://www...

8 years ago | 0

| accepted

Answered
MATLAB GUI: Axes do not retain modifications when using the plot function
It is the documented behavior of the high-level graphics functions like |plot| to adjust the properties of the |axes| object aut...

8 years ago | 0

| accepted

Answered
Why are these plots different?
The diagrams are different, because the scaling differs. This is exactly what is expected, when you define the x component of th...

8 years ago | 0

Answered
Running a while loop for an array
while i < length(t+1) I guess you mean: while i < length(t) + 1 This fails, because |i| is undefined before the l...

8 years ago | 0

Answered
Can't use imagesc with large log scale.
t = 1:400; f1 = logspace(1, 3, 150); f2 = logspace(1, 4, 150); z = randn(150, 400); figure; imagesc(t, f1, ...

8 years ago | 0

Answered
Numerical Integration warning issue
Examine the case of m=0, K=5. Then your function is: fun = @(x) imag(exp(-1i)) ./ x; % Or fun = @(x) sin(-1) ./ x; ...

8 years ago | 0

Answered
What does this code mean?
The first code replies a dt=1 for the first 4 calls and dt=inf for the fifth call. The second code sets the variable |entity....

8 years ago | 0

Answered
I get this error while trying to run the matlab feature selection library of the following link. https://it.mathworks.com/matlabcentral/fileexchange/56937-feature-selection-library
You forgot to ask a question. The message contains: This error was detected while a MEX-file was running. If the MEX-file...

8 years ago | 0

| accepted

Answered
Warning: Matrix is singular to working precision.
The last row and column of |AreaMatrix| contain zeros only. The rank of this matrix is 19, while it is a 20x20 matrix. In conseq...

8 years ago | 0

Answered
displaying correct marker type using text command
What exactly is your question? I am not able to display a 'square' in text command despite using marker 's' in the plot C...

8 years ago | 1

Answered
plot for different value of movmean(X,k) with a for loop
If you want a loop, use a loop: for k = 1:4 subplot(2,1,k); plot(movmean(e, k + 1), movmean(sigma, k + 1)) g...

8 years ago | 0

Answered
Is running MEX functions possible in MATLAB Mobile
Du you have the Signal Processing Toolbox? The call the |buffer| command, which is a mex function. Do you have an M-file for ...

8 years ago | 0

Answered
How do I name individual cells from a cell
A bold guess: You want to use a struct? Note that creating 12000x20 different variables or fields of a struct would be extrem...

8 years ago | 1

| accepted

Answered
How to get apostrophe's around each element in a matrix?
for i = 1:130 OutputV1 = csvread(sprintf('scope_%04d_1.csv', measnr{i}) end See: <https://www.mathworks.com/help/m...

8 years ago | 0

Answered
Repeat a calculation a number of times for each element in a vector
Pbs = Pl*L - Pg*G; -> this returns a column vector with 35040 elements No, this causes an error, because you cannot multiply...

8 years ago | 0

| accepted

Answered
Find amount of nonzero elements in matrix
It sounds like <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength FEX: RunLength (link)> would help: [Va...

8 years ago | 0

Answered
Best practice to preallocate for exporting simulation data
preallocation_logs = cell(1, number_of_simulations); preallocation_times = cell(1, number_of_simulations); for k = 1:nu...

8 years ago | 0

| accepted

Answered
represent differencital equation with ode45
This integrates the function from the start point x=[1,2,3] over the time 0 to 7: [EDITED - bug concerning t.' fixed] fu...

8 years ago | 0

Answered
Make a curve looks like staying below other curve
You can determine the view direction by: Aspect = get(AxesH, 'DataAspectRatio'); Position = get(AxesH, 'CameraPositi...

8 years ago | 0

Answered
How to disable GUI M-file with the same name as FIL file
It is a general feature of GUIDE to create the M file with the same name as the FIG file to store the callbacks. The name of the...

8 years ago | 0

Answered
Alternatives for eval when executing functions in matrix
Use |feval| instead. If you post the relevant part of your code, it would be very easy to suggest the modification explicitly...

8 years ago | 0

Answered
filter function not linear in numerator coeffcients
This difference between the solutions is tiny: max(abs(result1 - result2)) >> 1.1546e-14 This is an expected effect f...

8 years ago | 0

| accepted

Answered
How can i set a time for "input" waiting?
Using the command window and |timer| is a good idea. But it is much easier, if you do not use the command window, but a GUI with...

8 years ago | 0

Answered
Speed up a procedure that uses ACCUMARRAY and UNIQUE functions
I will C-mex this in the evening. But here the idea of an efficient solution: Data = load('matrix_A.mat'); A = Data.A...

8 years ago | 0

Answered
How to make a vertical label horizontal?
set(get(gca, 'XTicklabel'),'rotation', name) Almost. But: get(gca, 'XTicklabel') gets the strings of the XTickLabel...

8 years ago | 2

Answered
How to create a function to change the color of a pushbutton?
You can simply use |cell11_Callback| as callback function for all buttons, but use hObject instead of the hardcoded "handles.cel...

8 years ago | 0

| accepted

Load more