Answered
Where do MATLAB-created .txt files get saved?
If you do not specify a folder, the current directory is used. See help cd help pwd Note, that pwd is just a wrapper function...

4 years ago | 2

| accepted

Answered
Why my code doesn't execute correctly in other computers while works correctly in my computer?
The error message means, that the function coesamethod.m was not included during the creation of the executable. Try to include ...

4 years ago | 1

Answered
Matlab is significantly slower than Julia on simple evaluation
I can confirm your observation that Julia runs faster than Matlab for some problems. Answering your three questions is not easy ...

4 years ago | 7

Answered
How can I make a gif using subplots and avoid an error in function wgifc?
The calling style "subplot(121)" is outdated for over 20 years now. Use subplot(1, 2, 1) instead. You can simplify: reshape(fr...

4 years ago | 1

Answered
Is it ok for my optimization problem to take 2 hours to be solved?
This amount of runtime is either required, or caused by a bad programming technique, e.g. a forgotton pre-allocation or by perfo...

4 years ago | 0

Answered
How to recursively reduce the function arguments
This should work with str2func and eval. This is such a cruel programming technique, that I recommend not to use it. Such meta-...

4 years ago | 0

Answered
Storing different size cell array into a cell array.
Either copy only the existing elements and let the others be []: C = cell(24, 6); A = cell(1, 6); % Some test data A(:...

4 years ago | 0

| accepted

Answered
progrem witch sort matrix from user
k = 1; % Avoid "i" to reduce confusions with the imaginary unit ready = false; mat = {}; while ~ready mat{k} = i...

4 years ago | 0

| accepted

Answered
Requires uihtml an additional toolbox?
uihtml belongs to the standard toolboxes of Matlab. So you do not need a toolbox for this.

4 years ago | 0

Answered
what is the output type of a nagative fullfill function result
What is the purpose of the leading space in " \*.txt"? What does "if i did not select the subfolder" mean? Which subfolder? Do ...

4 years ago | 0

| accepted

Answered
How do I create a loop for an equation using if statements?
Use "logical indexing": y = rand(1, 100); t = 0:99; % Prefer the cyclenumber, not the seconds c = 17; index = (t == 0)...

4 years ago | 0

Answered
Unable to plot graphs
for f = 1:N Ms(f)=input(['Load Number:'num2str(f)','Cycles done:']); f=f+1; end This is not the way for loops work ...

4 years ago | 0

| accepted

Answered
Simplifying output in Matlab
The magnitude of the variables does not matter. For a computer, the addition of pi + 1.23456789, pi + 1.0 and pi+ 1.23456789e37 ...

4 years ago | 1

| accepted

Answered
Converting cosine to exponential form
cos(x) = 0.5 * (exp(1i * x) + exp(-1i * x)) exp(ix) = cos(x) + 1i * sin(x) I do not understand, why the desired output is (-1)...

4 years ago | 1

Answered
Expression to check if a matrix is a strict lower triangular one
You can stop the loops, if the first not matching element is found. Abbreviate the code by checking only the elements right fro...

4 years ago | 0

Answered
Change localization of files
if 1i == 1 This not true in any case. 1i is the imaginary unit. sqrt(-1) is not equal to 1 in any case. It is not 2,3,4,5,6 als...

4 years ago | 0

| accepted

Answered
Can't use for loop in matlab app designer
m = 3; disp(m) for i = 1:m % Not: length(m) disp('I loaded') end m is a scalar. Then length(m) is 1. A for loop from ...

4 years ago | 0

| accepted

Answered
function requires more input arguments to run
The call of ODE45 is inlcuded in the function to be integrated - twice. I guess, that you see the error message, when you click ...

4 years ago | 2

| accepted

Answered
How to get rid of the Error in Transcendental equation ?
Use the debugger to find out, what's going on: dbstop if error Matlab will stop in this line: NEFF1(ii)=double(vpasolve(Eqn))...

4 years ago | 0

Answered
I am trying to plot a graph for a second order ODE for the midpoint method.
t1 = 1:10; % A bold guess dt = t1(2) - t1(1); A = zeros(2, length(t1)); B = zeros(2, length(t1)); Now A and B ha...

4 years ago | 1

| accepted

Answered
Increase SPEED of nested for loops???
Use the profiler to find out, where the time is spent. If it is inside the sim() command, you have to modify this block, because...

4 years ago | 1

| accepted

Answered
input symbolic parameters in ode45
ODE45 integrates numerically. It does not offer a symbolic solution.

4 years ago | 0

Answered
The variable already defined ,but in the design apps it cannot recognized the variable.
Why do you assume, that "the variable A is already defined", if Matlab displays clearly, that it is not? What is your input Ene...

4 years ago | 0

Answered
Sharing a folder doesn't work (No permission)
Does the number of shared folder exceed the limits? See: https://www.mathworks.com/help/matlabdrive/ug/share-and-collaborate-on-...

4 years ago | 0

Answered
How to change the fontsize of labels not axsis.
h = gca; h.FontSize = 8; % here is problem. This changes the font size of the complete axes object. If you want to change the ...

5 years ago | 0

Answered
Change Name of String in Cell Array if Repeated More Than Once...
Do I understand correctly, that your question is: I have a cell string. How do I count the number of repetions of each char vec...

5 years ago | 0

Answered
Hello I need MATLAB help
See: FAQ: Process sequence of files

5 years ago | 0

Answered
How can I make 1 by length x array of random numbers from -pi to pi ??
See: help rand % Generate values from the uniform distribution on the interval (a, b): r = a + (b - a) .* rand(x, 1); Now ...

5 years ago | 1

| accepted

Answered
Counting x times zeros in a row on a given sequence
The question is not uniquely clear yet: What is the wanted answer for e.g. 20 subsequent zeros? Should the be counted as 1, 2 or...

5 years ago | 1

Answered
How to extract contiguous sequences of 3 items from the given sequence
If you really need the same (strange) format as for 2 elements: seq_three = cellstr(num2str([a(1:end-2); a(2:end-1); a(3:end)]'...

5 years ago | 0

| accepted

Load more