Answered

Converting text file to struct

Your text file is almost valid Matlab code: only the trailing semicolons are removed. Now you try to write some code, which inte...

Converting text file to struct

Your text file is almost valid Matlab code: only the trailing semicolons are removed. Now you try to write some code, which inte...

9 dagar ago | 1

Answered

how to Concatenate big string matrices of different sizes

With some bold guessing: % [UNTESTED] Please povide a small test data set keyIndex = 1; % Guessing, that the "case number" ...

how to Concatenate big string matrices of different sizes

With some bold guessing: % [UNTESTED] Please povide a small test data set keyIndex = 1; % Guessing, that the "case number" ...

9 dagar ago | 0

Answered

Unable to perform assignment because the size of the left side is 1-by-201 and the size of the right side is 200-by-1

Replace: ts = -prePeak:1/fs:posPeak; by ts = linspace(prePeak, postPeak, 201); But as far as I can see, you use ts only to m...

Unable to perform assignment because the size of the left side is 1-by-201 and the size of the right side is 200-by-1

Replace: ts = -prePeak:1/fs:posPeak; by ts = linspace(prePeak, postPeak, 201); But as far as I can see, you use ts only to m...

9 dagar ago | 0

Answered

There was an unexpected exception

The error message suggests to read the log file. So please read the log file and post a copy of the important information you fi...

There was an unexpected exception

The error message suggests to read the log file. So please read the log file and post a copy of the important information you fi...

9 dagar ago | 0

Answered

Error using eig Input matrix contains NaN or Inf.

The error message is clear: The input of eig() cannot contain NaN or Inf. Without seeing your code, the readers cannot guess, w...

Error using eig Input matrix contains NaN or Inf.

The error message is clear: The input of eig() cannot contain NaN or Inf. Without seeing your code, the readers cannot guess, w...

9 dagar ago | 0

Answered

Matrix sequence go diagonal

n = 6; % Or if you want: input ('sequence_matrix_'); v = zeros(1, n+1); % Pre-allocation v(2) = 1; % I...

Matrix sequence go diagonal

n = 6; % Or if you want: input ('sequence_matrix_'); v = zeros(1, n+1); % Pre-allocation v(2) = 1; % I...

9 dagar ago | 0

Answered

Sensitivity Analysis for a ODE

Sensitivity means, that you vary the initial values or parameters by a small value and compare the results of the integration. D...

Sensitivity Analysis for a ODE

Sensitivity means, that you vary the initial values or parameters by a small value and compare the results of the integration. D...

10 dagar ago | 1

| accepted

Answered

dde23 solver gets stuck in an infinite loop (I think?)

dde23 cannot stuck in an infinite loop. But it is easy to provide a system, which has a pole, such that the step size gets tiny ...

dde23 solver gets stuck in an infinite loop (I think?)

dde23 cannot stuck in an infinite loop. But it is easy to provide a system, which has a pole, such that the step size gets tiny ...

11 dagar ago | 0

Answered

I have 132 potential positions in a wind farm layout and I have to place 66 turbines on these positions. I want to know how to make combinations to place these 66 turbines.

The notes of dpb and David mean, that the number of possible solutions is too large to be useful, if you want to test all of the...

I have 132 potential positions in a wind farm layout and I have to place 66 turbines on these positions. I want to know how to make combinations to place these 66 turbines.

The notes of dpb and David mean, that the number of possible solutions is too large to be useful, if you want to test all of the...

11 dagar ago | 0

Answered

MATLAB crashes when I use any sound commands

The OpenGL flags are for managing the graphics, but your problem concerns the sound. Did you update the sound drivers already?

MATLAB crashes when I use any sound commands

The OpenGL flags are for managing the graphics, but your problem concerns the sound. Did you update the sound drivers already?

12 dagar ago | 0

Answered

make a subsubfolder in a newly made subfolder

[filepath, name, ext]= fileparts(dcmlist{jj}); % Extract file name mkdir(fullfile(nufolderpath, name, 'edn'));

make a subsubfolder in a newly made subfolder

[filepath, name, ext]= fileparts(dcmlist{jj}); % Extract file name mkdir(fullfile(nufolderpath, name, 'edn'));

13 dagar ago | 0

| accepted

Answered

copy file not working as it should

Use the debugger to find out, what's going on: for kk = 1 :numel(bmplist) if contains(bmplist{kk}, ptt) sourceFile =...

copy file not working as it should

Use the debugger to find out, what's going on: for kk = 1 :numel(bmplist) if contains(bmplist{kk}, ptt) sourceFile =...

13 dagar ago | 0

Answered

Derivative of a function in a particular point

Use one of the quotients of differences to get a numerical approximation of the derivative: x = 1.2345; h = sqrt(eps); dy_r...

Derivative of a function in a particular point

Use one of the quotients of differences to get a numerical approximation of the derivative: x = 1.2345; h = sqrt(eps); dy_r...

13 dagar ago | 0

Answered

How to convert a cell array to a compatible matrix?

CC = {rand(9,9), rand(5,4), rand(5,4), rand(6,4), rand(6,4), rand(8,4), rand(8,4), rand(9,4), rand(9, 4); ... rand(4,5), ra...

How to convert a cell array to a compatible matrix?

CC = {rand(9,9), rand(5,4), rand(5,4), rand(6,4), rand(6,4), rand(8,4), rand(8,4), rand(9,4), rand(9, 4); ... rand(4,5), ra...

13 dagar ago | 1

| accepted

Answered

Dimensions of arrays being concatenated are not consistent.

Use the debugger to check your code: dbstop if error Start your program after typing this in the command window. When Matlab s...

Dimensions of arrays being concatenated are not consistent.

Use the debugger to check your code: dbstop if error Start your program after typing this in the command window. When Matlab s...

13 dagar ago | 0

Answered

insert zero into matrix

You cannot "insert" a 0 in row 170, if the vector has 96 rows only. You can append zeros only: x = rand(96, 1); x(89:170) = 0;...

insert zero into matrix

You cannot "insert" a 0 in row 170, if the vector has 96 rows only. You can append zeros only: x = rand(96, 1); x(89:170) = 0;...

13 dagar ago | 0

| accepted

Answered

Break A While loop using a status Button

Insert a drawnow command inside the loop to let Matlab update the GUI. A small simplification: app.CANMSGStatusLamp.Color = 'B...

Break A While loop using a status Button

Insert a drawnow command inside the loop to let Matlab update the GUI. A small simplification: app.CANMSGStatusLamp.Color = 'B...

14 dagar ago | 1

Question

Are the CC BY-SA 3.0 and BSD-3-clause license compatible?

Code published in the Answers forum is covered by the "Creative Commons Attribution Share Alike 3.0 license", also called "CC BY...

14 dagar ago | 0 answers | 0

Answered

speed up ismember with two-dim data

function Test_Felix X = TestData; Y = TestData; % Original method: tic; mat_overlap = NaN(length(X), length(Y)); for ii ...

speed up ismember with two-dim data

function Test_Felix X = TestData; Y = TestData; % Original method: tic; mat_overlap = NaN(length(X), length(Y)); for ii ...

14 dagar ago | 0

| accepted

Answered

matlab -batch always failed with: | Error: Invalid use of operator.

The string after the -batch argument must contain a Matlab command. "./hello.m" is not a Matlab command, because "./" is the el...

matlab -batch always failed with: | Error: Invalid use of operator.

The string after the -batch argument must contain a Matlab command. "./hello.m" is not a Matlab command, because "./" is the el...

15 dagar ago | 0

| accepted

Answered

How to use multiple break statments

for i = 1:100 Ext.W22 = beta * Ext.W22; Ext.W22List(i) = Ext.W22; %% Convergance Check sub 2 sl...

How to use multiple break statments

for i = 1:100 Ext.W22 = beta * Ext.W22; Ext.W22List(i) = Ext.W22; %% Convergance Check sub 2 sl...

15 dagar ago | 1

Answered

Find minimum and maximum from same matrix

I guess, that zeros values should be ignored. Then: tmpPower = Power; tmpPower(tmpPower <= 0) = Inf; [minPositive, index1] = ...

Find minimum and maximum from same matrix

I guess, that zeros values should be ignored. Then: tmpPower = Power; tmpPower(tmpPower <= 0) = Inf; [minPositive, index1] = ...

15 dagar ago | 0

| accepted

Answered

Suggestions for vectorizing double/triple for loops in Matlab

The power operation is very expensive, so avoid it whenever it is possible: M = 50; N = 50; c = rand(N,M) + i*rand(N,M); eps...

Suggestions for vectorizing double/triple for loops in Matlab

The power operation is very expensive, so avoid it whenever it is possible: M = 50; N = 50; c = rand(N,M) + i*rand(N,M); eps...

15 dagar ago | 1

| accepted

Answered

strsplit causing issues with several functions

It looks like you have shadowed the builtin function strsplit by a user-defined function, which accepts less inputs. If you pos...

strsplit causing issues with several functions

It looks like you have shadowed the builtin function strsplit by a user-defined function, which accepts less inputs. If you pos...

15 dagar ago | 0

| accepted

Answered

imwrite does not work when file extension is given

Do not use "path" as name of a variable, because this shadows an important Matlab command. This does run usually, but during deb...

imwrite does not work when file extension is given

Do not use "path" as name of a variable, because this shadows an important Matlab command. This does run usually, but during deb...

16 dagar ago | 0

| accepted

Answered

Finding an average matrix from each matrix in an array

Which kind of array contains the matrices? A cell array, a numerical 3D array, a struct array? The solution depends on this deta...

Finding an average matrix from each matrix in an array

Which kind of array contains the matrices? A cell array, a numerical 3D array, a struct array? The solution depends on this deta...

16 dagar ago | 1

Answered

How can I use funtions defined in a column vector individually?

A small modification of your code let accept RK4 vector functions also: function [t, y] = RK4(fun, t0, tN, h, y0) t = t0:h:...

How can I use funtions defined in a column vector individually?

A small modification of your code let accept RK4 vector functions also: function [t, y] = RK4(fun, t0, tN, h, y0) t = t0:h:...

18 dagar ago | 1

| accepted

Answered

Merging several mat files in a row order

You did not explain, how a list of the files names can be obtained. I guess, that they can be found in the same folder: Folder ...

Merging several mat files in a row order

You did not explain, how a list of the files names can be obtained. I guess, that they can be found in the same folder: Folder ...

18 dagar ago | 1

Answered

guidata(hObject, handles) does not save my data

How did you create the GUI? This does not look as GUIDE. How are the callbacks called? Directly as defined during the creation o...

guidata(hObject, handles) does not save my data

How did you create the GUI? This does not look as GUIDE. How are the callbacks called? Directly as defined during the creation o...

18 dagar ago | 0

| accepted

Answered

Command for saving .M files ?

Name = 'file1.m' Doc = matlab.desktop.editor.findOpenDocument(Name); if Doc.Editable Doc.save; end

Command for saving .M files ?

Name = 'file1.m' Doc = matlab.desktop.editor.findOpenDocument(Name); if Doc.Editable Doc.save; end

18 dagar ago | 0