답변 있음
finding divisibility in every number from 1 to 25
If x can by divided by y: rem(x, y) == 0 Or: x / y == round(x / y) Another apporach is to calculate the list of multiples of...

4년 초과 전 | 0

답변 있음
Central difference method or Diff for trajectories?
There are different methods for numerical differentiation. Assume you have the positions store in x and the times in t. Then: F...

4년 초과 전 | 1

| 수락됨

답변 있음
Find equal pentagonal and square number
And a two-liner: n = 1:10000; find(any(((3*n.^2 - n)/2) == (n.^2).')) Matlab can be very elegant. Do you understand the detai...

4년 초과 전 | 0

답변 있음
Find equal pentagonal and square number
This sounds like a homework question. Then the standard way is that you post, what you have tried so fas and ask a specific ques...

4년 초과 전 | 0

| 수락됨

답변 있음
for loop stack the data
Maybe: col = cell(1, 176); row = cell(1, 176); for k = 77:176 [col{k}, row{k}] = find(M == k); end

4년 초과 전 | 0

답변 있음
how can i solve the error Reference to non-existent folder
I guess, that the code is not: ficheiro = fullfile(files(5), files(5).name); % but: ficheiro = fullfile(files(5).folder, file...

4년 초과 전 | 0

답변 있음
calculating combinations of two vectors simultanously?
a = [1, 3, 5, 7, 9]; b = [2, 4, 6, 8, 10]; index = nchoosek(1:numel(a), 3); a(index) b(index)

4년 초과 전 | 0

답변 있음
Converting 1 and 2 to False and True
result = [1; 2; 1; 1; 2]; Pool = {'FALSE', 'TRUE'}; Pool((result == 1) + 1)

4년 초과 전 | 0

답변 있음
Creating a counter inside the ode45 function
This is not useful. ODE45 has a stepsize controller, which rejectes steps if they do not match the tolerances. This means, that ...

4년 초과 전 | 0

답변 있음
Failed to convert character code error
See: https://www.mathworks.com/matlabcentral/answers/561905-error-with-new-version-of-readtable-r2020a This is a limitation of ...

4년 초과 전 | 0

답변 있음
The most efficient way to do multiple summation in Matlab?
After the code runs in half a minute now instead of a couple of days, it is time to examine the numerical stability: for i3 = 0...

4년 초과 전 | 0

| 수락됨

답변 있음
The most efficient way to do multiple summation in Matlab?
% Timings on: Matlab R2018b, Win10, i7: tic % A small k for bearable run times at first: YourSum_ori...

4년 초과 전 | 0

답변 있음
Is there a better way to use cellfun with arguments? and is it better than for-loop?
sizes = cellfun('size', cellArr, 1); Using the CHAR vector arguments is mentioned in the documentation as "backward compatibili...

4년 초과 전 | 1

| 수락됨

답변 있음
Strange result of find function
% Time_indices = find(abs([files(index).data.time]-t')< eps); % ^ If t and [...

4년 초과 전 | 0

| 수락됨

답변 있음
Replacing for loop in the function
Does f() accept a row vector as input? Does it reply a row vector or matrix then? If so: function I = func(f, a, b, n) h = (b ...

4년 초과 전 | 1

답변 있음
How to convert .java file to .mat file?
.java files contain source code in Java. .mat files are data files read by Matlab. It is not meaningful to convert source code t...

4년 초과 전 | 0

답변 있음
I am getting Datenum failed error
There is a difference. You do not tell, which difference it is, because you are not aware of what it is. The readers in the foru...

4년 초과 전 | 0

답변 있음
in this code for solving ODE using ode45, I am having problem with 'inline' function. Which function can be used instead of it?? Kindly guide me about it..
Do not use clear all inside a function. A good idea would be to avoid this brute clearing in general. But here it is really usel...

4년 초과 전 | 1

| 수락됨

답변 있음
timer with text and sound ?
pause(60); for k = 1:20 disp('Tap'); pause(10) disp('Rest'); pause(20); end The sleep command of java has...

4년 초과 전 | 0

답변 있음
Run function on all subfolders and save as separate structs
You are looking for txt files? Then: Mainfolder = 'D:\testnumber1\'; FileList = dir(fullfile(Mainfolder, '**', '*.txt')); %...

4년 초과 전 | 0

| 수락됨

답변 있음
Logic in fibonacci series
Do you know Matlab's debugger? Store the function in a script and open it in the editor. Then set a breakpoint on the left side....

4년 초과 전 | 1

답변 있음
What's the quickest way to find frequency of a signal?
See: https://www.mathworks.com/matlabcentral/answers/160059-finding-the-frequency-value-of-a-signal

4년 초과 전 | 0

답변 있음
How to write conditional statement/loop?
For V = linspace(0, 2) there is no V < 0. But in general: V = linspace(-2, 2); J = J_0.* exp((q * V) ./ (n * K * T)) .*...

4년 초과 전 | 1

| 수락됨

답변 있음
How to call a variable matrix from one script to another script
The first code shows a "script", the second one a "function". While scripts share their variables with the callers automatically...

4년 초과 전 | 0

답변 있음
Problem with figures in MATLAB - figures are full of glitching pixels
This is the best screenshot of the year 2021. Thank you. Did you update the graphic drivers? Does this occur also, if you use ...

4년 초과 전 | 0

| 수락됨

답변 있음
Automatically continue a line
This cannot work without further assumptions. Because the existing line is drawn with some noise, e.g. due to rounding effects, ...

4년 초과 전 | 2

답변 있음
I want to know the difference between 1 and 1.0000
The output is mimited to 4 digits after the decimal point. Then "1" means 1.0, and "1.0000" means that there is a digit differin...

4년 초과 전 | 1

답변 있음
switching from 2013b VERSION TO 2020. Accessing figure handle from plot command
No, this did not reply a figure handle in R2013b: ep_hdl=plot(0,0,'Visible','off','Color','k'); The plot command replied a lin...

4년 초과 전 | 0

답변 있음
Matrix dimension must agree HELP
Are you sure, that you mean the elementwise multiplication and not a matrix multiplication? inv(J1) .* M % Elementwise multi...

4년 초과 전 | 0

답변 있음
How can I fix this error and what does mean by should return 1 or two arguments help pls
Which userfcn do you provide? You have to insert changes there, so please post the code of your userfcn. It should start with ...

4년 초과 전 | 0

| 수락됨

더 보기