답변 있음
How to replace repeating values for each column by NaN?
A = [1 2 3 4; ... 2 3 4 4; ... 3 1 3 1; ... 3 1 3 2]; M = [false(1, wi...

대략 4년 전 | 0

| 수락됨

답변 있음
How do I create this full diagonal matrix
This is a Toeplitz matrix. See: doc toeplitz

대략 4년 전 | 2

답변 있음
Unable to re-install R2021b after updating it (Java exception).
Ignoring the update messages is a really bad idea. If you are afraid of bugs during the updates, create a backup of your compute...

대략 4년 전 | 1

답변 있음
Calculating power in a loop has different result from the matlab power function
Neither the power operator nor the loop produce the exact result: x = sym(13); x^15 fprintf('%.0f\n', 13^15) y = 13; for k ...

대략 4년 전 | 1

| 수락됨

답변 있음
Comparing implicit methods - Euler implicit, Crank Nicolson, three-time level
A bold guess: phi = zeros(n_points+1); phi(1)=3; phi(n_points) = 1; This creates phi as square matrix. I'd assume you want a...

대략 4년 전 | 0

답변 있음
How to export a table including column names?
Maybe there is a typo in the original code? If I adjust the variable names, which must be legal Matlab symbols in my R2018b vers...

대략 4년 전 | 0

| 수락됨

답변 있음
How to numerically solve and plot after solving the integration with a constant Multiplication
B = 51; C = 10; S0 = 17.34; % ??? lam_d = 19.34; % ??? H1 = (S0/lam_d)^2 / pi; K = @(t, y) (sqrt(sin(t) - t * cos(t...

대략 4년 전 | 0

| 수락됨

답변 있음
i was trying to run three different mat files some reason only the first one is read by matlab
It is a frequent cause of unexpected behavior, that MAT files contain other variables that the user assumes. Therefore it is rec...

대략 4년 전 | 0

답변 있음
How to read a txt file with 2 comma separated values into an array?
data = fileread('resultat.data'); value = strsplit(data, ',');

대략 4년 전 | 0

| 수락됨

답변 있음
Quasi-euclidean distance metric in 3D
As the documentation reveals, that it handles 2D matrices only: https://www.mathworks.com/help/images/ref/bwdistgeodesic.html . ...

대략 4년 전 | 0

답변 있음
Index exceeds the number of array elements (11819)
You run the loops over 11903. The data have 11819 elments only. Most likely you want to replace for n=1:11903 by num = numel...

대략 4년 전 | 0

답변 있음
compare the column 2 of two matrix and forming the matrix with same entries in column 2 of Second Matrix.
A1 = [115.28 30 1; ... 115.26 33 2; ... 115.25 8 3; ... 115.24 21 2; ... 115.24 25 1; ... 115.21 2 2; ....

대략 4년 전 | 0

| 수락됨

답변 있음
Write a recursive function called fibor
If it is really the problem, that you use two functions, simply join then to one function: function out = fibor(n, a, b) if na...

대략 4년 전 | 1

| 수락됨

답변 있음
Mandelbrot set escape value is complex?
Here a cleaned version of your code: Calculating norm() twice is a waste of time. abs() is faster than norm(). No need to cr...

대략 4년 전 | 1

| 수락됨

답변 있음
Total lines of code of MATLAB product
The question is too vague to be answered. Do you mean the core Matlab or inclusive all toolboxes? Many toolbox functions call th...

대략 4년 전 | 1

답변 있음
How do you sum concatenated variables in a system of ODES with a For Loop?
This is trivial, if you do not create a bunch of variables, but an array: K(1) = 0; K(2) = C(1) * A + B; K(3) = C...

대략 4년 전 | 0

답변 있음
How to write my function output in various form?
This works automatically with any function. The ~ simply ignores the replied value in the caller. You do not have to consider th...

대략 4년 전 | 0

답변 있음
Why it keeps show the error incorrect use of '=' operator?
If you run a Matlab version before R2021a, use: pnl = uipanel(fig, 'Position', [0 0 1 1], ... 'Title', "Ur...

대략 4년 전 | 0

| 수락됨

답변 있음
How do I find the first of the shortest words in a sentence?
You are on the right track. len = strlength(s0); % Better then "l" to avoid confusion with "1" min(len) This replies the mi...

대략 4년 전 | 1

답변 있음
Would I be able to download an older version of MATLAB if I were to purchase a license?
Yes. If you buy the license of a current version, you can download and activate older versions in addition.

대략 4년 전 | 0

| 수락됨

답변 있음
Fast Euclidean Distance Calculation
There is no reason to call bsxfun, if the arrays have the same sizes: % d = sqrt(bsxfun(@plus, sum(X .* X, 2), ... % ...

대략 4년 전 | 0

| 수락됨

답변 있음
A bit of MATLAB syntax fun
No, I cannot guess it. I'm even astonished, that copy&pasting ">> x = 7;" works inspite of the ">>". Is this documented? By th...

대략 4년 전 | 0

답변 있음
Speeding up to find minimum value using min() function
c = c(:); % Make it a column vector to be sure nc = numel(c); bin = [c(1); (c(1:nc-1) + c(2:nc)) * 0.5; c(...

대략 4년 전 | 0

답변 있음
Impossible to print *really* vector plots when containing a lot of data
Yes, your oberservation is correct. If the 'RendererMode' of the figure is set to 'auto', Matlab enables the OpenGL renderer if ...

대략 4년 전 | 0

| 수락됨

답변 있음
Is there any way to display a progress bar in command window while the code is running?
Yes. You find several dozens of progressbars and waitbars for figures, dialogs, the command window and the statusbar in the File...

대략 4년 전 | 0

| 수락됨

답변 있음
How to calculate a triple sum with a dependent index using Matlab?
What is the intention of: if n==0 || N This conditio is TRUE, if n is zero or N is not zero. I assume you want: if n==0 |...

대략 4년 전 | 1

답변 있음
Problem with plotting dots in points
The loop does not depend on the loop counter: i = 8; % <- this is the index in all iterations for c = 1:8 I assume you mean:...

대략 4년 전 | 0

답변 있음
Convert portion of matrix under the diagonal to column vector
A = [ 1 2 3 4 5; ... 2 1 2 3 4; ... 3 4 1 2 5; ... 0 3 2 1 2; ... % 0 inserted 5 4 3 2 1]; s = ...

대략 4년 전 | 1

답변 있음
All combinations of cell arrays
A = [1 2 3; ... 1 2 4 ; ... 1 3 5]; B = [1 6; ... 4 5]; C = [repelem(A, size(B, 1), 1), ... repmat(B...

대략 4년 전 | 0

답변 있음
How do I use MATLAB app designer to display a command window for my app?
This is "gun-shot programming". Please read the documentation: doc fprintf doc fopen Both commands do not write text to a GUI...

대략 4년 전 | 0

| 수락됨

더 보기