답변 있음
Need help with error in for loop
Your code tests f1<f2 and f1>f2, but not f1 == f2. In this case x1(i+1) and x2(i+2) are not created. r = (sqrt(5)-1) / 2; d = ...

4년 초과 전 | 0

답변 있음
Matlab has encountered an internal problem and needs to close
Matlab R2014a is not compatible with Windows 10. See https://www.mathworks.com/support/requirements/previous-releases.html R20...

4년 초과 전 | 0

답변 있음
created file does not appear?
Are you searching in the correct folder? What does cd tell you? Or do you save the file with an absolute path? Maybe you are ...

4년 초과 전 | 1

| 수락됨

답변 있음
how can i solve this ?
"Phimean=51*1" means, that this variable has the sie [51, 1]. After Vp=reshape(Vp,size(Phimean)); Cp has the same size also....

4년 초과 전 | 0

답변 있음
matching the element of matrix with an array
A = {[2,3;2,7], [3,2;3,4;3,8], [4,3;4,5], [5,4;5,10], [7,2;7,8;7,12]}; B = [17,8,14,4,18] C = cell(size(A)); for iA = 1:numel...

4년 초과 전 | 1

| 수락됨

답변 있음
How can i make this code block a function?
A simplified version of your code: function y = my_conv(x, h) z = x(:) .* h; [r, c] = size(z); y = []; for t = 2:r+c ...

4년 초과 전 | 0

답변 있음
why is this function running infinitely?
% Simplified version: Master1 = eye(22,22); Master1(1, 1) = 0; Master1(22, 22) = 0; scan = 3; temp = Master1; i ...

4년 초과 전 | 0

답변 있음
where in my code I am thinking wrong?
length() is fragile: It uses to longer dimension. You cannot be sure if your table has more rows than columns. Use height() inst...

4년 초과 전 | 0

답변 있음
save the output data of GUI
Kp = getappdata(0, 'Kp'); Kr = getappdata(0, 'Kr'); if isfile('myData.mat') % older: exist('myData.mat','file') S = ...

4년 초과 전 | 1

| 수락됨

답변 있음
use of global variables
I agree with John, Rik and Stephen, and dare to post this as an answer. Can global variables be used in this way? Maybe. The a...

4년 초과 전 | 0

답변 있음
Is it possible that the "m. file" code is converted from the double precision to the single precision??
This function has been developped an tested since 1995. You cannot be sure, if it works correctly with singles as inputs. conve...

4년 초과 전 | 0

| 수락됨

답변 있음
Hi, what does ; exactly mean?
Please read the Getting Started chapters of the documentation. This is recommended for beginners also: https://www.mathworks.com...

4년 초과 전 | 1

답변 있음
for loop return answer in string matrix
Ci = randn(5, 4); pool = ["False", "True"]; a = pool((Ci > 0) + 1)

4년 초과 전 | 0

답변 있음
Importing .dat file into MATLAB
Searching for more information on the given page I've found: Note: See the PDS JADE SIS Document for more details on the format...

4년 초과 전 | 0

답변 있음
Random matrix with no repeats in rows and columns.
Create the matrix elementwise. Choose a random element from the available elements. Exclude elements on top and left of the elem...

4년 초과 전 | 1

| 수락됨

답변 있음
how to use mod function
mod() requires 2 inputs. You provide one only in the callback.

4년 초과 전 | 0

답변 있음
Why does it give me a problem stating that, Index must not exceed 1?
I guess, that the error occurs here: plot(real(del_ZS1(60)),imag(del_ZS1(60)),'kr') The message means, that del_ZS1 is a scala...

4년 초과 전 | 0

답변 있음
How to save values from a for loop into a matrix
Do not use "save" as name of a variable. This would shadow an important built-in function, which causes troubles frequently. Yo...

4년 초과 전 | 0

답변 있음
How to delete columns from a matrix, conditionally?
keep = sum(~isnan(data), 1) >= 100; data = data(:, keep); Your approach does not work, because the matrix data is changed, but...

4년 초과 전 | 0

| 수락됨

답변 있음
How to call a value from the command window to the editor window
Is it really a small integer? Then simply type "123". If it is a much more complicated nested struct, please explain this. It ma...

4년 초과 전 | 1

답변 있음
Matlab: In for loop, change name of variable
This is a very bad idea. The severe problems caused by the dynamic creation of variables have been discussed in the forum exhaus...

4년 초과 전 | 0

답변 있음
Avoiding drift while creating angular rotation with variable degree increments
Let's start with a simplification of the code: phi = 90; angle = 16; ddeg_min = 0.1; ddeg_max = 10; deg(1) = 0;...

4년 초과 전 | 0

| 수락됨

답변 있음
how can I use a loop instead of cellfun
Why do you want to use a loop? To improve the speed? Then there are better methods: cellfun('isempty', f1) is faster than cellf...

4년 초과 전 | 0

답변 있음
Slower processing of arrays in structures and pre-allocation
In the first example, the pre-allocation accelerates the code by about 0.15 seconds. With using a field of a struct, the benefi...

4년 초과 전 | 0

답변 있음
What toolbox is required for allpaths() built-in command?
The documentation looks, like allpaths belongs to Matlab's standard toolbox, but it was introduced in R2021a. Which Matlab versi...

4년 초과 전 | 0

| 수락됨

답변 있음
How to create a diagonal matrix that starts at (1,1)?
Maybe you mean: n = 4; lambda = 0.2; A = eye(n) * lambda % Or: A = diag(repmat(lambda, 1, n))

4년 초과 전 | 0

답변 있음
How to extract N array from a for loop?
The question is not really clear to me. With some guessing: a = cell(1, 2); % Pre-allocate for i = 1:2 x = input('ent...

4년 초과 전 | 1

답변 있음
How to solve second order coupled ODEs with bvp4c?
function dy = YourODE(t, y) k = 17; dy = [y(3); ... y(4); k * y(1) * y(2); ... k * y(1) * y(2)]; end I...

4년 초과 전 | 0

| 수락됨

답변 있음
i want to solve that system using 4 order kutta method
The output is a simple point at [0, 0]. You start at 0. Then the expression x2/(x2/20) + 1 is NaN, because you divide by 0: x2...

4년 초과 전 | 2

| 수락됨

답변 있음
repmat usage for cellarray
If this is what you want: cell_array = PG01 PG02 PG03 . . . PG32 PG01 PG02 PG03 . . . PG32 . . ...

4년 초과 전 | 0

| 수락됨

더 보기