답변 있음
Using an external array in ode45
This cannot work for several reasons: ODE45 is designe to integrate smooth functions with a certain accuracy. Using non-smooth ...

대략 4년 전 | 1

| 수락됨

답변 있음
How to get the correct answer for LU Decomposition with partial pivoting?
You forgot to apply the permutation matrix P to b. The results are correct: P * L * U - A % == zeros, fine b = P * b; Then ...

대략 4년 전 | 0

| 수락됨

답변 있음
searching first two consecutive ones and set to 0
y = [0 0 1 1 1 1 1 1 1 1 1]; index = strfind(y, [1, 1]); if any(index) y(index(1):index(1)+1) = 0; end y

대략 4년 전 | 0

답변 있음
Apply logical mask to every matrix in array
B = reshape(1:24, 2,3,4); mask = logical([1,0,1; 0,1,0]); sB = size(B); B = reshape(B, [], sB(3)); % Join the first tw...

대략 4년 전 | 0

답변 있음
define a pattern to use with dir and get the file names containing numbers
This does not work with the patterns of the operating system. Use a regexp call to filter the names instead: List = dir('*.t...

대략 4년 전 | 1

| 수락됨

답변 있음
Suppressing outputs (ans) in MATLAB
You need a semicolon after the call of the function: paths = CEVPaths(S,r,q,vol0,beta,T,N,NPaths); % ...

대략 4년 전 | 1

답변 있음
i want to double titles in one graph
This works using the text() command.

대략 4년 전 | 0

답변 있음
Error using second . Invalid date/time class. (I am working on guide)
A bold guess: persistent timein if x >= p_x(1) && x <= p_x(2) && y >= p_y(1) && y <= p_y(2) timein = datetime('now'); ...

대략 4년 전 | 1

답변 있음
want a rows to split into multiple rows
X = ones(1, 90); Y = reshape(X, 3, []); % 2nd argument is determined automatically % The long form: Y = reshape(X, 3, nume...

대략 4년 전 | 0

| 수락됨

답변 있음
invalid index in program
Use the debugger to examine the cause of problems. Type this in the command window: dbstop if error Run the code again until i...

대략 4년 전 | 0

답변 있음
MATLAB R2021b error running installer
What does the event viewer tell you about the occurring problems? Do you try to run the installer from the protected download f...

대략 4년 전 | 0

답변 있음
How do I find the mean of certain parts of a cell array?
This is easy, if you store the values in a numerical array instead of a cell. Why do you prefer a cell array? But you can creat...

대략 4년 전 | 0

| 수락됨

답변 있음
If value in one vector is in another, assign the value of the other column of the second vector to a third
I do not understand exactly, what you are asking for. A guess: T = 0:20; s = zeros(1, numel(T)); stimuli = [4 8 14 2 16 6 15 ...

대략 4년 전 | 0

답변 있음
the length of the time span in ode45
The small discretization and rounding errors accumulate over the time. Small deviations of the initial values can be amplified a...

대략 4년 전 | 1

| 수락됨

답변 있음
sort 4th dimension of a 4D matrix with indexing
Maybe you mean: for i=1:83 % vols(:,:,:,i)=vols_sorted(:,:,:, bSortIdx(i)); vols_sorted(:,:,:,i) = vols(:,:,:, bSortI...

대략 4년 전 | 1

| 수락됨

답변 있음
Trying to get the user to input consecutive values
for i = 1:length(Rtot) If Rtot is a scalar, the loop runs one time only. I guess you want: for i = 1:Rtot The message "What i...

대략 4년 전 | 1

답변 있음
I CODED THE PROGRAM BUT DON'T KNOW WHY STATEMENT IS NOT SHOWING, Using the singular value decomposition, prove that σ¯(AB) ≤ σ¯(A)¯σ(B)
The problem is: for i=10: size(A, 1) size(A, 1) replies 5. Then the loop from 10 up to 5 is not entered at all. Do you mean: ...

대략 4년 전 | 1

| 수락됨

답변 있음
Write a function that gives a tree with one input
n = 9; disp(char(10 * (abs(-n+1:n-1) < (1:n).') + ' ')) Or with a function: affAbre(n) function affAbre(n) s = repmat(' '...

대략 4년 전 | 0

답변 있음
Vectorising Multiplying each column from a matrix with a square matrix and the tranpose of this column
Then please post you code. It is much faster on my computer: h = rand(2790, 3591); Pn = rand(2790, 2790); tic R = zeros(1,...

대략 4년 전 | 0

답변 있음
How to convert table to a csv file and save it in a remote location?
Folder = 'D:\Your\Folder'; File = [all_files(k).name(1:end-8) '_.csv']; writematrix(Stats, fullfile(Folder, File));

대략 4년 전 | 0

| 수락됨

제출됨


WindowAPI
Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API

대략 4년 전 | 다운로드 수: 4 |

5.0 / 5
Thumbnail

답변 있음
Generate a sine wave that has no stop-time
f = 5; a = 1; Fs = 1000; t1 = 1; figure; while 1 % Runs until you press Ctrl-c t = 0 : 1/Fs :t1-1/Fs; x =...

대략 4년 전 | 0

| 수락됨

답변 있음
Using number/counter instead of changing all variables names that end on same index
Do not hoide indices in the names of variables. This is a standard pitfall for beginners and discussed frequently. Use real indi...

대략 4년 전 | 0

| 수락됨

답변 있음
How to simplify code into a for loop?
M_diag = rand(4,4); C_diag = rand(4,4); K_diag = rand(4,4); a = phi(1:4, 1); q_f = a ./ (diag(M_diag) .* s .^ 2 + diag(C...

대략 4년 전 | 0

| 수락됨

답변 있음
TUTORIAL: Comma-Separated Lists and How to Use Them
An interesting application of comma-separated lists are dynamic indexing. You can use it to extract a specific dimension of a mu...

대략 4년 전 | 2

답변 있음
how to write summation
S = 0; for p = 1:i+1 % Indices are 1-based in Matlab S = S + A(p) + C(i - p); end

대략 4년 전 | 1

답변 있음
delate a specific number in an array and the number that have the index corresponding to the this number in an other array
A=[0,0,3,4,5,6,7,8,9,0]; B=[10,9,8,7,6,5,4,3,2,1]; match = (A == 0); A(match) = [] B(match) = [] Or the other way around:...

대략 4년 전 | 1

| 수락됨

답변 있음
Not sure what's wrong with my code
The providing of variables as inputs and outputs as well as sharing the data using nested cells is explained in the free online ...

대략 4년 전 | 0

답변 있음
I am having a hard time understanding how matrix works.
.* is the elementwise multiplication, while * is the matrix multiplication: [a,b; c,d] .* [e,f; g,h] = [a*e, b*f; c*g, d*h] ...

대략 4년 전 | 0

답변 있음
Download earlier version of MATLAB as free-trial (R2019a)
Ask the sales team or support of MathWorks. Usually only the current version is provided as trial, but maybe they can make an ex...

대략 4년 전 | 0

더 보기