답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 0

| 수락됨

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

4년 초과 전 | 0

답변 있음
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년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 1

| 수락됨

답변 있음
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년 초과 전 | 1

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 2

| 수락됨

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 1

| 수락됨

답변 있음
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년 초과 전 | 1

| 수락됨

답변 있음
input symbolic parameters in ode45
ODE45 integrates numerically. It does not offer a symbolic solution.

4년 초과 전 | 0

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

답변 있음
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 ...

4년 초과 전 | 0

답변 있음
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...

4년 초과 전 | 0

답변 있음
Hello I need MATLAB help
See: FAQ: Process sequence of files

4년 초과 전 | 0

답변 있음
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 ...

4년 초과 전 | 1

| 수락됨

답변 있음
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...

4년 초과 전 | 1

답변 있음
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)]'...

4년 초과 전 | 0

| 수락됨

답변 있음
How do I remove white spaces on the command window after the answer prints a string?
Use fprintf to ontrol the output exactly. Relying on the implicit calling of display() has less ways to influence the output.

4년 초과 전 | 0

답변 있음
can't store the output of a definite integral using int(f, a, b ) in a matrix initialized with zeros
G(i,j) = int((p4{i}*p4{j}/den),[0,1]); G is a numerical variable and the output of int() is a symbolic variable. You cannot st...

4년 초과 전 | 0

| 수락됨

답변 있음
About preallocating for speed
for K = 1:M ... TSE_Lin(K) = norm(e)^2; CR(K) = (2 * K) * 100 / N; end The variables TSE_lin and CR grow in ...

4년 초과 전 | 0

답변 있음
Normal vector from points in 3d space
See https://www.mathworks.com/matlabcentral/fileexchange/22042-plane_fit https://www.mathworks.com/matlabcentral/answers/49621...

4년 초과 전 | 0

더 보기