Answered
decrease the elapse time
The output of the profile is useful - thanks. The most time is spent here: [days(:,:,i), time(:,:,:,i), I(:,:,:,i), Ta(:,:,:,i...

7 years ago | 0

Answered
How would I change the color of the angular axes without changing the color of the grid lines in polar plot
AxesH = polaraxes; theta = 0:0.01:2*pi; rho = sin(2*theta).*cos(2*theta); polarplot(AxesH, theta, rho) AxesH.GridColor...

7 years ago | 0

Answered
I do not understand why my code still gives me errors
Index exceeds the number of array elements (1). Error in RK (line 8) k(:,1)=feval(fun,t(j),y(:,j)); After the line: ...

7 years ago | 1

| accepted

Answered
Index exceeds matrix dimensions ERROR
Using global variables is a bad programming style. It impedes the debugging massively. It is hard to find out, which code has se...

7 years ago | 0

Answered
How to convert 24-bit signed hex from .csv file to an array of decimal data?
dataTable = readtable('demo.csv'); data = table2array(dataTable(:,1)); data = strrep(data, '0x', ''); dataDec = b...

7 years ago | 1

| accepted

Answered
Indexing cell array similar to excell
Maybe like this: Data = rand(7, 25); % Example data, actually 177x25 Names = {'A 123', 'A 123', 'B 456', 'A 123', 'B 456', '...

7 years ago | 0

| accepted

Answered
Calling Matlab GUI popupmenu callback on click
No, there is no callback in the Matlab level. You can use the Java callbacks, if your "Matlab GUI" is a figure, see https://und...

7 years ago | 0

Answered
part of file name
s = ' Hello_World_2020 ' c = strsplit(s, '_') c{2}

7 years ago | 0

Answered
looping though multiple sub-directories
FileList = dir('C:\Base\Folder\**\*.nii'); for k = 1:numel(FileList) File = fullfile(FileList(k).folder, FileList(k).name)...

7 years ago | 0

Answered
How to open my .m files in App Designer?
You do not have to open the files to use a slider for te modification of a constant. You need to write the code as a function, w...

7 years ago | 0

| accepted

Answered
array values are overwritten
Prefer file names including leading zeros: image0001.jpg, image 0002.jpg etc. Then the numeical order equals the alphabetical or...

7 years ago | 1

| accepted

Answered
Delete table from GUI app variable
Perhaps you mean: delete(app.table)

7 years ago | 0

Answered
How to rename all instances of persistent variables?
Simply remove the persistent command temporarily, rename the variable and insert persistent again. You can open the file e.g. ...

7 years ago | 1

| accepted

Answered
How to update variable names after a "clear"
Clearing variables is rarely useful in Matlab, but a waste of time only. So on one hand it is not exactly clear, what you are as...

7 years ago | 0

Answered
Variable is not fully defined on some execution paths.
Does this help? tcell2 = cell(10,10); for t = 1:10 for s = 1:10 tcell2{t,s} = imcrop(pic2, ... [(t-...

7 years ago | 0

| accepted

Answered
How to select numbers?
F = rand(1,400); M = rand(1,400); Tf = log(-F) / 0.73; Tm = log(-M) / 1.2; It is hard to guess, what this means: "I should...

7 years ago | 1

Answered
I can“t save
Some virus scanners limit the write access to the user's Documents folder to block encryption trojans. Check the logs of the vir...

7 years ago | 0

Answered
Replace pixels in a matrix without using histeq
for i = 1:1:r %go through rows for j = 1:1:c %columns img_heq(i, j) = T(img(i,j) + 1); end end

7 years ago | 2

| accepted

Answered
Error using mex: undefined reference for user build package
According to the documentation https://www.mathworks.com/help/matlab/matlab_external/calling-lapack-and-blas-functions-from-mex-...

7 years ago | 0

| accepted

Answered
TITLE: How to dynamically determine the name of the variable to be called in the function
I do not get the point. "excel file with data-series in EXACT order of countries (Y_aa Y_bb, Y_cc., i.e.: aa bb cc.." Whe...

7 years ago | 1

Answered
Removing data from a structure that is less than a certain threshold
The iterative growing and shrinking of arrays is extremely expensive. Better: nTraj = numel(AllTraj.Passive); remove = false(...

7 years ago | 1

| accepted

Answered
Accessing data within a structure
The chosen data structure demands for loops. There is no "efficient" solution, which extracts the fields in a vectorized way. Yo...

7 years ago | 0

| accepted

Answered
Acessing imrect with another callback
It is a bad idea to set the AppData of the root object. This has the sme disadvantages as global variables. The complete communi...

7 years ago | 0

Answered
why my plot not being displayed?
Try plot(x, y, 'o') to check, if x and/or y are scalars, which plot infinitesimal small dots only.

7 years ago | 0

Answered
Angle between 2 3D straight lines
A = [3,7,9]; B = [4,5,8]; C = [4,5,0]; S1 = B - A; S2 = C - A; Theta = atan2(norm(cross(S1, S2)), dot(S1, S2)); W. Kah...

7 years ago | 2

| accepted

Answered
How to store a variable in a vector?
iVec = 0.001:0.001:0.999999; result = zeros(1, numel(iVec)); for k = 1:numel(iVec) i = iVec(k); ... your code r...

7 years ago | 0

| accepted

Answered
How to optimize the computing process of a matrix ?
Pre-allocate the output of loops. Example: num = zeros; for nn=1:length(Y) NUM = size(Y{1,nn}); num(nn...

7 years ago | 2

| accepted

Answered
Trying to run a script many times and combine all the results
eList = cell(1, 100); for k = 1:100 callYourScript; eList{k} = e; end A cell array is useful, if the elements, here...

7 years ago | 0

| accepted

Answered
monte carlo simulation in matlab two dices roll
n = 10; % Number or trials throw = randi(6, n, 2); % Value of throws, 2 dice SumThrow = sum(throw, 2...

7 years ago | 0

| accepted

Load more