Answered

Image Saving to Variable in Workspace (NOT imwrite)

"In this case sp_possible_quadtree is a double. where the contents are either 0 for Black, or an integer 1, 2, 3, 4, ... n" LLL...

Image Saving to Variable in Workspace (NOT imwrite)

"In this case sp_possible_quadtree is a double. where the contents are either 0 for Black, or an integer 1, 2, 3, 4, ... n" LLL...

5 días ago | 0

Answered

Extracting string and number pairs from a mixed string

The two lines marked with %%% are used to convert substrings like '(Fe0.5Co0.5)58.5' into 'Fe29.25Co29.25', after which the desi...

Extracting string and number pairs from a mixed string

The two lines marked with %%% are used to convert substrings like '(Fe0.5Co0.5)58.5' into 'Fe29.25Co29.25', after which the desi...

6 días ago | 1

| accepted

Answered

How can I convert a number to time?

>> V = randi(58232,7,1) % fake data V = 7565 33124 27334 694 19632 9445 ...

How can I convert a number to time?

>> V = randi(58232,7,1) % fake data V = 7565 33124 27334 694 19632 9445 ...

6 días ago | 0

| accepted

Answered

how to Vectorize this for loop

Try doing something like this: [fid,msg] = fopen('CANDec(day_1_9).txt','rt'); assert(fid>=3,msg) % good practice to check the ...

how to Vectorize this for loop

Try doing something like this: [fid,msg] = fopen('CANDec(day_1_9).txt','rt'); assert(fid>=3,msg) % good practice to check the ...

6 días ago | 0

| accepted

Submitted

Interactive Regular Expression Tool

Develop and refine regular expressions in an interactive figure that shows all REGEXP's outputs.

6 días ago | 27 downloads |

Answered

scalar vs matrix vs vector vs array??

Just like in mathematics, the only difference is their size. MATLAB does not have special classes for scalars, vectors, matrice...

scalar vs matrix vs vector vs array??

Just like in mathematics, the only difference is their size. MATLAB does not have special classes for scalars, vectors, matrice...

6 días ago | 2

| accepted

Answered

Reducing repeated elements in an array by a factor

>> V = [1,2,2,2,2,2,2,5,6]; >> N = 3; >> X = cumsum([1,diff(V)~=0]); >> F = @(v) {v(1:ceil(numel(v)/N))}; >> cell2mat(accuma...

Reducing repeated elements in an array by a factor

>> V = [1,2,2,2,2,2,2,5,6]; >> N = 3; >> X = cumsum([1,diff(V)~=0]); >> F = @(v) {v(1:ceil(numel(v)/N))}; >> cell2mat(accuma...

7 días ago | 2

| accepted

Answered

Storing Function Handles in structure

>> fun = @(x,y,z) [x,y,z]; >> baz = @(n,v) v(n); % helper function >> a = @(n) @(x,y,z)baz(n,fun(x,y,z)); Testing: >> f = a(...

Storing Function Handles in structure

>> fun = @(x,y,z) [x,y,z]; >> baz = @(n,v) v(n); % helper function >> a = @(n) @(x,y,z)baz(n,fun(x,y,z)); Testing: >> f = a(...

7 días ago | 1

| accepted

Answered

creating channels in an array

"What does this error mean?" You are trying to access array elements that do not exist! You defined h to have size 4x5(x1x1x1....

creating channels in an array

"What does this error mean?" You are trying to access array elements that do not exist! You defined h to have size 4x5(x1x1x1....

7 días ago | 0

| accepted

Answered

Problem using for loop

a = 1:10; n = numel(a); for kk = 1:n for ii = max(1,kk-2):min(n,kk+2) x = a(ii); end end

Problem using for loop

a = 1:10; n = numel(a); for kk = 1:n for ii = max(1,kk-2):min(n,kk+2) x = a(ii); end end

7 días ago | 0

| accepted

Answered

how to use interp1() function

The problem is that you are using the default x values, which for a vector input are defined as 1:numel(v) These default point...

how to use interp1() function

The problem is that you are using the default x values, which for a vector input are defined as 1:numel(v) These default point...

7 días ago | 0

| accepted

Answered

Error using textscan Mismatch between file and format character vector. Trouble reading 'Numeric' field from file (row number 1, field number 3)

The second field is clearly not numeric, containing values like 020520t1xy10z12.tif 020520t1xy10z12.tif 020520t1xy10z12.tif ...

Error using textscan Mismatch between file and format character vector. Trouble reading 'Numeric' field from file (row number 1, field number 3)

The second field is clearly not numeric, containing values like 020520t1xy10z12.tif 020520t1xy10z12.tif 020520t1xy10z12.tif ...

8 días ago | 1

Answered

Insert zero columns in matrices inside a cell array

Where C is your cell array: for k = 1:numel(C) C{k}(:,end+1:30) = 0; end

Insert zero columns in matrices inside a cell array

Where C is your cell array: for k = 1:numel(C) C{k}(:,end+1:30) = 0; end

8 días ago | 0

| accepted

Answered

Delete values in one matrix that aren't contained in a second matrix

>> M1 = dlmread('coordiates_variable.dat'); >> M2 = dlmread('coordinates.txt'); >> idx = ismembertol(M1(:,1:3),M2, 0.0001, 'By...

Delete values in one matrix that aren't contained in a second matrix

>> M1 = dlmread('coordiates_variable.dat'); >> M2 = dlmread('coordinates.txt'); >> idx = ismembertol(M1(:,1:3),M2, 0.0001, 'By...

8 días ago | 0

Answered

How to convert a 8760X30matrix to a 365X30 matrix?

>> inp = rand(8760,30); % fake data matrix >> out = mean(permute(reshape(inp,24,[],30),[2,3,1]),3); And checking: >> size(out...

How to convert a 8760X30matrix to a 365X30 matrix?

>> inp = rand(8760,30); % fake data matrix >> out = mean(permute(reshape(inp,24,[],30),[2,3,1]),3); And checking: >> size(out...

8 días ago | 0

| accepted

Answered

for-loop over Structure Array

"Can anybody exlpain to me, why this happens" Because MATLAB is (as far the end-user is concerned) pass-by-value and not pass-b...

for-loop over Structure Array

"Can anybody exlpain to me, why this happens" Because MATLAB is (as far the end-user is concerned) pass-by-value and not pass-b...

8 días ago | 0

| accepted

Answered

Dynamic on the fly expression/function

Vector Indices: You can do this quite easily by generating vectors of indices and taking advantage of the fact that addition and...

Dynamic on the fly expression/function

Vector Indices: You can do this quite easily by generating vectors of indices and taking advantage of the fact that addition and...

8 días ago | 1

| accepted

Answered

how to call a variable inside a function

No need for a loop: nAZ = histc(char(lower(stateNames)).','a':'z').'; E.g.: >> nAZ = histc(char(lower(stateNames)).','a':'z')...

how to call a variable inside a function

No need for a loop: nAZ = histc(char(lower(stateNames)).','a':'z').'; E.g.: >> nAZ = histc(char(lower(stateNames)).','a':'z')...

9 días ago | 0

Answered

Text file i/o problem....I always get 0 with charnum ...whats the problem with the code??

Your code has likely has several bugs, e.g. you were checking for literal "character" as opposed to using the contents of the ch...

Text file i/o problem....I always get 0 with charnum ...whats the problem with the code??

Your code has likely has several bugs, e.g. you were checking for literal "character" as opposed to using the contents of the ch...

10 días ago | 0

| accepted

Answered

how to do a loop and call a function

As described in the question, you will have to do something like this: L = ???; D = ???; P = ???; r = ???; c = ???; a = ??...

how to do a loop and call a function

As described in the question, you will have to do something like this: L = ???; D = ???; P = ???; r = ???; c = ???; a = ??...

10 días ago | 0

Answered

Undefined function 'de' for input arguments of type 'double'.

"... the vector "de" is well defined in mdlderivatives of my s-function." And that is part of the problem: mdlderivatives has a...

Undefined function 'de' for input arguments of type 'double'.

"... the vector "de" is well defined in mdlderivatives of my s-function." And that is part of the problem: mdlderivatives has a...

10 días ago | 0

| accepted

Answered

How can I save the differents values of a variable which is into a for loop?

Just use indexing, e.g.: Ckk = cell(1,nel); for iel = 1:nel ... your code Ckk{iel} = ... variable you want to stor...

How can I save the differents values of a variable which is into a for loop?

Just use indexing, e.g.: Ckk = cell(1,nel); for iel = 1:nel ... your code Ckk{iel} = ... variable you want to stor...

10 días ago | 0

Answered

error during selecting dynamically image from folder

"I want to randomaly select 8 images from specific folder how i can do that" Something like this: P = 'path to the folder wher...

error during selecting dynamically image from folder

"I want to randomaly select 8 images from specific folder how i can do that" Something like this: P = 'path to the folder wher...

10 días ago | 0

| accepted

Answered

How to compare the saved names of two images stored in different folders ?

I don't think imageDatastore particularly helps in this case. Something like this: P1 = 'G:\MTech\InputImages'; P2 = 'G:\MTech...

How to compare the saved names of two images stored in different folders ?

I don't think imageDatastore particularly helps in this case. Something like this: P1 = 'G:\MTech\InputImages'; P2 = 'G:\MTech...

10 días ago | 1

| accepted

Answered

I have a matrix A = [1 1 0 0 1 1]

>> A = [1,1,0,0,1,1]; >> B = toeplitz([0,A]) B = 0 1 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 1...

I have a matrix A = [1 1 0 0 1 1]

>> A = [1,1,0,0,1,1]; >> B = toeplitz([0,A]) B = 0 1 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 1...

10 días ago | 0

Answered

How can I run many .mat files in loop .?

How to process multiple files is explained in the MATLAB documentation: https://www.mathworks.com/help/matlab/import_export/pro...

How can I run many .mat files in loop .?

How to process multiple files is explained in the MATLAB documentation: https://www.mathworks.com/help/matlab/import_export/pro...

11 días ago | 0

Answered

What is the meaning of this word !

Apparently you are using this third-party toolbox: https://github.com/petercorke/robotics-toolbox-matlab As far as I understan...

What is the meaning of this word !

Apparently you are using this third-party toolbox: https://github.com/petercorke/robotics-toolbox-matlab As far as I understan...

11 días ago | 1

| accepted

Answered

how to replace all elements with zeros after "ONE" (number) in every column of matrix???

>> mat = randi([0,1],[6,8]) mat = 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0...

how to replace all elements with zeros after "ONE" (number) in every column of matrix???

>> mat = randi([0,1],[6,8]) mat = 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0...

11 días ago | 1

Answered

Writing function for fliping vectors

The main problem is that you are not returning the variable that you flip. You ignored the input argument (which already breaks ...

Writing function for fliping vectors

The main problem is that you are not returning the variable that you flip. You ignored the input argument (which already breaks ...

12 días ago | 1

| accepted

Answered

divide 3d matrix (840,64,1536) by 1d matrix (1536,1)

bsxfun(@rdivide,A,reshape(B,1,1,[]))

divide 3d matrix (840,64,1536) by 1d matrix (1536,1)

bsxfun(@rdivide,A,reshape(B,1,1,[]))

12 días ago | 1

| accepted