Answered

How to clear (not close) all the opened figures?

function clfall FigList = findall(groot, 'Type', 'figure'); for iFig = 1:numel(FigList) try clf(FigList(iFig)); ...

How to clear (not close) all the opened figures?

function clfall FigList = findall(groot, 'Type', 'figure'); for iFig = 1:numel(FigList) try clf(FigList(iFig)); ...

7 månader ago | 0

| accepted

Answered

Calling sub-function (local function) from another file on Matlab

This would work: % main.m file: ----------- function out = main(Command, varargin) switch Command case 'sub_function' ...

Calling sub-function (local function) from another file on Matlab

This would work: % main.m file: ----------- function out = main(Command, varargin) switch Command case 'sub_function' ...

7 månader ago | 0

Answered

My code is running so long and never gives solution.

To accelerate your code, you can store the results of e.g. D1^5/pi^2 in a variable. This avoids 20 expensive power operations in...

My code is running so long and never gives solution.

To accelerate your code, you can store the results of e.g. D1^5/pi^2 in a variable. This avoids 20 expensive power operations in...

7 månader ago | 0

Answered

Index in position 1 exceeds array bounds (must not exceed 1).

We cannot know, what YBUS and IP_DATA is. It is your turn to check, if the error message concerns the variable e, g or f. Do thi...

Index in position 1 exceeds array bounds (must not exceed 1).

We cannot know, what YBUS and IP_DATA is. It is your turn to check, if the error message concerns the variable e, g or f. Do thi...

7 månader ago | 0

| accepted

Answered

Saving Tiffs from cell array using imwrite in a loop

for k = 1:numel(ca) imwrite(ca{k}, sprintf('s%d.tiff', k), 'compression', 'none'); end Prefer a naming scheme like s0001....

Saving Tiffs from cell array using imwrite in a loop

for k = 1:numel(ca) imwrite(ca{k}, sprintf('s%d.tiff', k), 'compression', 'none'); end Prefer a naming scheme like s0001....

7 månader ago | 0

| accepted

Answered

Merge two colums into one

Assuming that X is your matrix: C = X(:, 2); match = isnan(C); C(match) = X(match, 1);

Merge two colums into one

Assuming that X is your matrix: C = X(:, 2); match = isnan(C); C(match) = X(match, 1);

7 månader ago | 0

| accepted

Answered

I want to save multiple images in a folder?

See https://www.mathworks.com/matlabcentral/answers/57446-faq-how-can-i-process-a-sequence-of-files for k = 1:5 FileName = s...

I want to save multiple images in a folder?

See https://www.mathworks.com/matlabcentral/answers/57446-faq-how-can-i-process-a-sequence-of-files for k = 1:5 FileName = s...

7 månader ago | 0

| accepted

Answered

Error after moving function .m file: 'Previously accessible file "...\z_estimate.m" is now inaccessible'

"saved the file in the top-level MATLAB folder instead of the subfolder "my_functions", which is also on my Matlab path" This s...

Error after moving function .m file: 'Previously accessible file "...\z_estimate.m" is now inaccessible'

"saved the file in the top-level MATLAB folder instead of the subfolder "my_functions", which is also on my Matlab path" This s...

7 månader ago | 0

Answered

From Euler Angle to Angle between 2 vectors

There is no mathematical definition of "one angle between 2 3D-bodies". There is more than 1 degeree of freedom. An angle betwee...

From Euler Angle to Angle between 2 vectors

There is no mathematical definition of "one angle between 2 3D-bodies". There is more than 1 degeree of freedom. An angle betwee...

7 månader ago | 0

Answered

Error Index exceeds matrix dimensions

After [x ,y] = min(Data(i)); x is a scalar. Then x(i) cannot work for i > 1. By the way, as Adam has said alread, x(i)=x(i) ...

Error Index exceeds matrix dimensions

After [x ,y] = min(Data(i)); x is a scalar. Then x(i) cannot work for i > 1. By the way, as Adam has said alread, x(i)=x(i) ...

7 månader ago | 0

Answered

Coding for nested loop problem

for p = 1:10 for q = 1:10 if p ~= q ... end end end Without a for loop: x = rand...

Coding for nested loop problem

for p = 1:10 for q = 1:10 if p ~= q ... end end end Without a for loop: x = rand...

7 månader ago | 0

| accepted

Answered

Data filtering(Give a constraint to the length of each index )

There are more efficient ways, but starting with a simple loop is a good apporach: data = [ 1 201; 1 202; 2 301; 2 313; 2 311;...

Data filtering(Give a constraint to the length of each index )

There are more efficient ways, but starting with a simple loop is a good apporach: data = [ 1 201; 1 202; 2 301; 2 313; 2 311;...

7 månader ago | 1

| accepted

Answered

Creating 1024 ToggleButtons with almost the same callback

A simplified version of your code: function buttonPress(hObject, EventData, handles) global TData brtn = get(handles.slider1,...

Creating 1024 ToggleButtons with almost the same callback

A simplified version of your code: function buttonPress(hObject, EventData, handles) global TData brtn = get(handles.slider1,...

7 månader ago | 0

| accepted

Answered

lock first app if second is running

You can use waitfor in the main function and provide the handle of the uifigure. [EDITED] I assume, that https://www.mathwork...

lock first app if second is running

You can use waitfor in the main function and provide the handle of the uifigure. [EDITED] I assume, that https://www.mathwork...

8 månader ago | 0

| accepted

Answered

How to introduce a phase shift to a existing vector

This is not possible, if you do not have additional information. You can apply a phase shift with a certain number of elements, ...

How to introduce a phase shift to a existing vector

This is not possible, if you do not have additional information. You can apply a phase shift with a certain number of elements, ...

8 månader ago | 1

Answered

question regarding 'copyfile' function from folder to folder

This is exactly, what you find in the documentation. Please read: help copyfile doc copyfile [SUCCESS,MESSAGE,MESSAGEID] = ...

question regarding 'copyfile' function from folder to folder

This is exactly, what you find in the documentation. Please read: help copyfile doc copyfile [SUCCESS,MESSAGE,MESSAGEID] = ...

8 månader ago | 0

| accepted

Answered

To take pictures from FLIR (Cx series) camera every 30 secs

Use a timer object and insert the code for taking a picture in its callback. doc timer

To take pictures from FLIR (Cx series) camera every 30 secs

Use a timer object and insert the code for taking a picture in its callback. doc timer

8 månader ago | 1

Answered

Changing the name of a variable throughout the code but only want it to change in a section.

Copy the text block, which you want to modify, to a new editor window. Perform the wanted modifications. Copy the block back to ...

Changing the name of a variable throughout the code but only want it to change in a section.

Copy the text block, which you want to modify, to a new editor window. Perform the wanted modifications. Copy the block back to ...

8 månader ago | 0

Answered

How can I use "system" command with input without typing myself all the input everytimes ?

Please take a look into the documentation of dammif: https://www.embl-hamburg.de/biosaxs/manuals/dammif.html Here you can see h...

How can I use "system" command with input without typing myself all the input everytimes ?

Please take a look into the documentation of dammif: https://www.embl-hamburg.de/biosaxs/manuals/dammif.html Here you can see h...

8 månader ago | 1

| accepted

Answered

Efficient algorithm for a duplication matrix

For n=300 this needs 1.3 sec instead of 27.5 sec: tic m = n * (n + 1) / 2; nsq = n^2; D = spalloc(nsq, m, nsq); row = 1...

Efficient algorithm for a duplication matrix

For n=300 this needs 1.3 sec instead of 27.5 sec: tic m = n * (n + 1) / 2; nsq = n^2; D = spalloc(nsq, m, nsq); row = 1...

8 månader ago | 1

| accepted

Answered

How to detect change in mean value of a signal

It is impossible to detect a change, if it occurs in the first or last few frames. Ist there only 1 change of the mean? Then f...

How to detect change in mean value of a signal

It is impossible to detect a change, if it occurs in the first or last few frames. Ist there only 1 change of the mean? Then f...

8 månader ago | 0

Answered

How can I export only specific data from a text file to a matrix?

With some guessing, that you want the part behind ':Solar_Radio_Flux:' : Key = ':Solar_Radio_Flux:'; Str = fileread(FileName)...

How can I export only specific data from a text file to a matrix?

With some guessing, that you want the part behind ':Solar_Radio_Flux:' : Key = ':Solar_Radio_Flux:'; Str = fileread(FileName)...

8 månader ago | 0

| accepted

Answered

Parse error help please

I guess, this line is failing: Jsx*der(wx) = (Fflz + Frlz)*w/2 - (Ffrz + Frrz)*w/2 + (Ffyv + Fry)*h; Yes, of course. In Matlab...

Parse error help please

I guess, this line is failing: Jsx*der(wx) = (Fflz + Frlz)*w/2 - (Ffrz + Frrz)*w/2 + (Ffyv + Fry)*h; Yes, of course. In Matlab...

8 månader ago | 0

Answered

Alternative to delaunayn function supported by MATLAB coder for the C++ code generation

Matlab uses qhull for the calculation of delaunayn. qhull is a library written in C, see here: http://www.qhull.org/ So it shou...

Alternative to delaunayn function supported by MATLAB coder for the C++ code generation

Matlab uses qhull for the calculation of delaunayn. qhull is a library written in C, see here: http://www.qhull.org/ So it shou...

8 månader ago | 1

| accepted

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...

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...

8 månader 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...

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...

8 månader 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: ...

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: ...

8 månader 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...

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...

8 månader 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...

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...

8 månader 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', '...

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', '...

8 månader ago | 0

| accepted