Answered

32 bit exe with a code developed in 2017b Matlab version

I don't think you can make a backward-compatible 32-bit without changing your code. It's just one of those issue with backward c...

32 bit exe with a code developed in 2017b Matlab version

I don't think you can make a backward-compatible 32-bit without changing your code. It's just one of those issue with backward c...

4 years ago | 0

Answered

Cleaner way to write a series of similar sequences

Nope, that style of coding is going to end up with repeated codes like the one you have shown. This should be a good read for yo...

Cleaner way to write a series of similar sequences

Nope, that style of coding is going to end up with repeated codes like the one you have shown. This should be a good read for yo...

5 years ago | 0

Answered

Error with parallel toolbox

Do not use batch and scripts if not needed. _"but then won't run in parallel, and seems to just ignore the parfor loop, or pe...

Error with parallel toolbox

Do not use batch and scripts if not needed. _"but then won't run in parallel, and seems to just ignore the parfor loop, or pe...

5 years ago | 1

Answered

mod(a,b) floating-point rounding error

Nope, still a tricky rounding error. isequal(x(3, 121), 0.2) ans = 0 So x(3, 121) is NOT 0.200. Instea...

mod(a,b) floating-point rounding error

Nope, still a tricky rounding error. isequal(x(3, 121), 0.2) ans = 0 So x(3, 121) is NOT 0.200. Instea...

5 years ago | 0

Answered

How can I graph the results of the matrix?

plot(real(solucion), imag(solucion), 'x') xlabel('real') ylabel('imag')

How can I graph the results of the matrix?

plot(real(solucion), imag(solucion), 'x') xlabel('real') ylabel('imag')

5 years ago | 0

Answered

spectral subtraction in audio file

I see you've already seen some FEX submissions. The question you seem to have is _"how to use this code instead of "nargin"_. na...

spectral subtraction in audio file

I see you've already seen some FEX submissions. The question you seem to have is _"how to use this code instead of "nargin"_. na...

5 years ago | 0

| accepted

Answered

'parfor' slower than 'for'

When using parfor, Matlab must know if the variables can be processed independently of each other (sliced variable). In your 2...

'parfor' slower than 'for'

When using parfor, Matlab must know if the variables can be processed independently of each other (sliced variable). In your 2...

5 years ago | 2

Answered

How to solve problem of out memory

The code is very weird. It immediately summons itself with no switch to break the recursion it seems. Also, inputs D and X are j...

How to solve problem of out memory

The code is very weird. It immediately summons itself with no switch to break the recursion it seems. Also, inputs D and X are j...

5 years ago | 0

Answered

Does arrayfun function used on a nongpu array utilise multiple cores of CPU?

It doesn't appear to use multi-core, and if anything, it's slower than a regular for loop for most cases. X = 1:100000...

Does arrayfun function used on a nongpu array utilise multiple cores of CPU?

It doesn't appear to use multi-core, and if anything, it's slower than a regular for loop for most cases. X = 1:100000...

5 years ago | 0

Answered

Help needed to apply for loop.

Your while loop conditions is odd, why i < 2? See comments below. Not sure what a "strange" answer is. This would be a math log...

Help needed to apply for loop.

Your while loop conditions is odd, why i < 2? See comments below. Not sure what a "strange" answer is. This would be a math log...

5 years ago | 0

Answered

How to slice a 4-level cell array to perform a parlour

AllCurves = cell(1, 3); for class = 1 : 3 C = AllCurves{class}; parfor caso = 1 : 17 A = C{caso}...

How to slice a 4-level cell array to perform a parlour

AllCurves = cell(1, 3); for class = 1 : 3 C = AllCurves{class}; parfor caso = 1 : 17 A = C{caso}...

5 years ago | 0

| accepted

Answered

Loading large binary files in Matlab, quickly

<https://www.mathworks.com/discovery/stream-processing.html> Seems like you have to use stream processing. Essentially load N...

Loading large binary files in Matlab, quickly

<https://www.mathworks.com/discovery/stream-processing.html> Seems like you have to use stream processing. Essentially load N...

5 years ago | 0

| accepted

Answered

question about the resulting dendrograms in hierarchical clustering

Dendrogram defaults to 30 leaf nodes to draw. To draw more, specify # of leaf nodes to draw. Y = linkage(rand(64, 3)); ...

question about the resulting dendrograms in hierarchical clustering

Dendrogram defaults to 30 leaf nodes to draw. To draw more, specify # of leaf nodes to draw. Y = linkage(rand(64, 3)); ...

5 years ago | 0

| accepted

Answered

How to reference a cell in a matrix only if it is preceded by a specific number?

A = [rand(10, 1) [16 4 15 6 16 4 4 16 4 3]']; Idx = find(A(1:end-1, 2) == 16 & A(2:end, 2) == 4) + 1; B = A(Idx, :) ...

How to reference a cell in a matrix only if it is preceded by a specific number?

A = [rand(10, 1) [16 4 15 6 16 4 4 16 4 3]']; Idx = find(A(1:end-1, 2) == 16 & A(2:end, 2) == 4) + 1; B = A(Idx, :) ...

5 years ago | 0

| accepted

Answered

How can I improve the speed of the following code

<https://www.mathworks.com/matlabcentral/answers/42335-array-cellfun-vs-for-loop> I see you're using a lot of |cellfun| and n...

How can I improve the speed of the following code

<https://www.mathworks.com/matlabcentral/answers/42335-array-cellfun-vs-for-loop> I see you're using a lot of |cellfun| and n...

5 years ago | 1

Answered

How to detect forgery in an image without original image

Are you asking for image forensic analysis tools? I'm not aware of any built-in Matlab tool for this purpose, so you'll have to ...

How to detect forgery in an image without original image

Are you asking for image forensic analysis tools? I'm not aware of any built-in Matlab tool for this purpose, so you'll have to ...

5 years ago | 0

| accepted

Answered

Vectorize a parfor loop to save time

I've looked through the code and it is mostly vectorized already. See comments though for minor improvements. At this point, you...

Vectorize a parfor loop to save time

I've looked through the code and it is mostly vectorized already. See comments though for minor improvements. At this point, you...

5 years ago | 0

| accepted

Answered

How can I calculate percentage of Euclidean distance?

Assuming you want similarity % as explained here, alter the equation as such : <https://stats.stackexchange.com/questions/5306...

How can I calculate percentage of Euclidean distance?

Assuming you want similarity % as explained here, alter the equation as such : <https://stats.stackexchange.com/questions/5306...

5 years ago | 0

| accepted

Answered

How can I smoothly switch between images?

ImOn = ones(100, 'logical'); %For you, imread('lamp_on.png'); ImOff = zeros(100, 'logical'); %For you, imread('lamp_off.p...

How can I smoothly switch between images?

ImOn = ones(100, 'logical'); %For you, imread('lamp_on.png'); ImOff = zeros(100, 'logical'); %For you, imread('lamp_off.p...

5 years ago | 1

| accepted

Answered

Is there a simple way to convert all fields of a struct to local variables?

Look into |inputParser| and the StructExpand option. <https://www.mathworks.com/help/matlab/ref/inputparser.html> % S = str...

Is there a simple way to convert all fields of a struct to local variables?

Look into |inputParser| and the StructExpand option. <https://www.mathworks.com/help/matlab/ref/inputparser.html> % S = str...

5 years ago | 0

Answered

Fast interp1 on multiple vectors, same X, but different V and Xq per vector

The |for| loop was pretty fast for me. See the timing results below: data = rand(10000,512); times = [0 : size(data, 1) ...

Fast interp1 on multiple vectors, same X, but different V and Xq per vector

The |for| loop was pretty fast for me. See the timing results below: data = rand(10000,512); times = [0 : size(data, 1) ...

5 years ago | 0

Answered

how to vectorise this for loop?

Jint = 263; Jnew2 = 360; z = 262144; numHarm = 400; n = rand(z, 1); M = rand(z, 1); alpha = rand(1, numHarm)...

how to vectorise this for loop?

Jint = 263; Jnew2 = 360; z = 262144; numHarm = 400; n = rand(z, 1); M = rand(z, 1); alpha = rand(1, numHarm)...

5 years ago | 0

Answered

what is the expect command???????

Don't delete one-by-one. Instead, delete all rows at once, then all columns at once. A = rand(16, 18); B =[ 5 15; ...

what is the expect command???????

Don't delete one-by-one. Instead, delete all rows at once, then all columns at once. A = rand(16, 18); B =[ 5 15; ...

5 years ago | 1

| accepted

Answered

Receiving I/O error 32 when opening another program (EnergyPlan) inside parfor

energyPlanPath = 'C:\Users\HumptyDumpty\Desktop\Programme etc\Studium\4o Semestre\Master Thesis\EnergyPlan\energyPLAN.exe'; ...

Receiving I/O error 32 when opening another program (EnergyPlan) inside parfor

energyPlanPath = 'C:\Users\HumptyDumpty\Desktop\Programme etc\Studium\4o Semestre\Master Thesis\EnergyPlan\energyPLAN.exe'; ...

5 years ago | 1

| accepted

Answered

Rearranging Bytes in a Cell

A = {'00 11 22 33 AA BB'; '00 11 22 3D AA BC'; '02 11 32 33 AA BB'}; A = cellfun(@(x) sprintf('%c%c%c%c %c%c%c%c %c%c%c%c',...

Rearranging Bytes in a Cell

A = {'00 11 22 33 AA BB'; '00 11 22 3D AA BC'; '02 11 32 33 AA BB'}; A = cellfun(@(x) sprintf('%c%c%c%c %c%c%c%c %c%c%c%c',...

5 years ago | 0

Answered

write vectors in cell array to excel

Is this what you're trying to do? %Making a sample cell array with variable-length vectors Data = cell(50, 2); for j ...

write vectors in cell array to excel

Is this what you're trying to do? %Making a sample cell array with variable-length vectors Data = cell(50, 2); for j ...

5 years ago | 0

| accepted

Answered

How to show what direction an object is facing

Because you're missing "depth" information, it's still very hard to do what you want. To you, it's a roof and "north" slant ...

How to show what direction an object is facing

Because you're missing "depth" information, it's still very hard to do what you want. To you, it's a roof and "north" slant ...

5 years ago | 0

| accepted

Answered

Save one and after data in one programme

Here's a simple case for writing 11 files. Without details in your question, you'll have to start from this template and modify ...

Save one and after data in one programme

Here's a simple case for writing 11 files. Without details in your question, you'll have to start from this template and modify ...

5 years ago | 0

Answered

How can I protect a public script from being changed?

<https://www.mathworks.com/help/matlab/matlab_prog/protect-your-source-code.html> Perhaps convert your code to p-code to disc...

How can I protect a public script from being changed?

<https://www.mathworks.com/help/matlab/matlab_prog/protect-your-source-code.html> Perhaps convert your code to p-code to disc...

5 years ago | 1

| accepted

Answered

How to access vector elements one by one and do some calculation?

p = 2; e1 = 0.5; c = 10; D = [0,0,100,0,39,0,0,55,0,7]; Re = zeros(size(D)); GT50Loc = D > 50; %Greater than 50...

How to access vector elements one by one and do some calculation?

p = 2; e1 = 0.5; c = 10; D = [0,0,100,0,39,0,0,55,0,7]; Re = zeros(size(D)); GT50Loc = D > 50; %Greater than 50...

5 years ago | 0

| accepted