Question


How to access recent comments in the FileExchange?
I cannot find an efficient way to check, if my FileExchange submissions got new comments. In the old interface there was a list ...

5 years ago | 1 answer | 1

1

answer

Answered
Matlab JIT engine nested loops data type
This is a good question. Matlab's JIT was partially documented in Matlab 6.5 (2001), but afterwards MathWorks avoided to publish...

5 years ago | 2

| accepted

Answered
Help for setting the formatSpec
fprintf(fid,'%d %d %d\n', E); It is much faster to open the file once only: fid = fopen('Result.txt','a'); for k ...

5 years ago | 0

| accepted

Answered
Array indices must be positive integers or logical values
I looks like this is a script. Then is shares the workspace variables with its caller. I guess, that you have created an array c...

5 years ago | 1

Answered
Randomize a vector with letters making a N back test
s = 'A':'J'; str = s(randi(numel(s), 1, 150)); idx = 5:4:numel(str); str(idx) = str(idx - 3)

5 years ago | 0

| accepted

Answered
Creating empty txt file
The save() command stores the contents of the current workspace in a MAT file. See: doc save To create an empty text file, use...

5 years ago | 0

| accepted

Answered
How can I convert a time vector of HH:SS to a decimal?
v = datetime({'03:30', '04:45'}, 'InputFormat', 'HH:mm') hour(v) + minute(v) / 60

5 years ago | 0

Answered
Unrecognized function or variable 'mustBeA'.
The function mustBeA was introduced in Matlab R2020b. You are using 2020a. In consequence upgrading the the way to go or write a...

5 years ago | 0

| accepted

Answered
how to get the answer for x from 3^x=17 ?
x = log(17) / log(3) 3^x

5 years ago | 0

Answered
Searching Folder for Variable File Name
Use the functional form: dir(fileName) Omitting the parentheses is equivalent to: dir('fileName') A simplified version of yo...

5 years ago | 0

| accepted

Answered
Suggest me the best image encryption algorithm
A short answer: AES-CBC. An implementation: key = uint8('myPassword'); data = randi([0, 255], 640, 480, 3, 'uint8'); % Ge...

5 years ago | 0

Answered
how to swap some vector value?
% [EDITED] Now working if S has not a multiple of 10 elements: S = 1:25; a = 2; % Move 2 elements b = 10; % in blocks of 1...

5 years ago | 0

Answered
Programmatically adjusting editor fontsize does not work
Your code changes the values, which are applied at the next start of Matlab. You can use FEX: CmdWinTool Font = CmdWinTool(...

5 years ago | 0

Question


Why does the speed of histcounts vary so much?
I have a vector with integer or floating point values and want to count the number of occurences. histcounts() uses the lase el...

5 years ago | 1 answer | 0

1

answer

Answered
input the matrix from user
A = input('Please input the matrix like "[1, 2; 3, 4]":'); % Type e.g.: % [1, 2; 3, 4] meanA = mean(A(:)) % Or in modern...

5 years ago | 0

| accepted

Answered
I would like to hire an explainer
Maybe this is a better point to start: https://www.mathworks.com/services/consulting.html

5 years ago | 1

| accepted

Answered
Question regarding the smooth filter function when using the Savitzky-Golay method
According to the documentation, the degree can be determined and the window size is replied as 2nd output: % SMOOTHDATA(...,'...

5 years ago | 1

Answered
How to document the input from Matlab into the file
Using input in the command window is useful for short hacks only. For real applications either use a GUI and store the inputs by...

5 years ago | 0

| accepted

Answered
Error evaluating inline function - Not enough inputs to inline function
These linesmust fail: ode45('D:\Kin\Ode.m',tspan, SM0); [Coeff_ODE,Residuals_ODE] = nlinfit(time, conc, 'D:\ Kin\ fitODE', i...

5 years ago | 0

| accepted

Answered
How to combine matrices
permute(reshape(permute(NETPLP, [2, 1, 3]), 4, []), [2, 1]) All reshaping operations of N-dimensional arrays can be solved by t...

5 years ago | 0

Answered
Accelerate executable file speed
See: https://undocumentedmatlab.com/matlab/wp-content/cache/all/articles/speeding-up-compiled-apps-startup/index.html https:/...

5 years ago | 0

| accepted

Answered
Finding the relation between x and y using the available xy-dataset and interpolation
Import the data using readmatrix and call interp1 for a linear interpolation: yi = interp1(x, y, xi) where xi are the points, ...

5 years ago | 0

| accepted

Answered
ARRY EXEEDS RANDOM NUMBER
If you request 74.5GB of RAM for a matrix, care for having this size of memory plus some head room. On a 160 GB RAM machine, the...

5 years ago | 0

Answered
How to save 30x1 data for 100 loop in Mat.file ?
A simplified version of your code: n = 30; A = rand(n, 2) * 5; DT = [2.5, 2.5]; Value = sqrt(sum((DT - A) .^ 2, 2)...

5 years ago | 0

| accepted

Answered
What is the alternative function for evalin?
You asked clearly for the runtime of the code. Distributing a variable by evalin() is a drawback, as explained by others already...

5 years ago | 3

Answered
Find maximum clique with recursive function
I've reduced the run time from 60 to 2 seconds using this method: Convert the {1 x N} cell array of vectors to a [N x N] logica...

5 years ago | 1

| accepted

Answered
Excecute computation on push button
With assignin('base','Ac',Ac); you create the variable Ac in the base workspace. If you do not declare this variable as globa...

5 years ago | 1

Answered
Close cmd while getting results
What is the purpos of: if toc(timer1)<waiting This not a loop and it does not wait until your command in the system() call is ...

5 years ago | 0

Answered
How to return error code from compiled exe, without throwing up dialogue box?
Does this answer still work: https://www.mathworks.com/matlabcentral/answers/100904-how-can-i-retrieve-an-exit-code-from-a-stan...

5 years ago | 1

| accepted

Answered
In Guide, How to add border
figure; uicontrol('Style', 'Text', 'String', '', 'BackgroundColor', 'k', ... 'Position', [20, 20, 64, 24]); uicontrol('St...

5 years ago | 0

Load more