Answered
Problems with indexing into an array with nan (indexing on 2 variables)
for ii = 1:size(bandphase,1) for jj = 1:size(Bandphase_logical,1) tmp = bandphase(ii,:); tmp(Band...

8 years ago | 0

| accepted

Answered
How to convert a 1XM array into NXM array?
You could do this yourself, but by far the simplest solution is to *download* Jos's excellent |padcat|: <https://www.mathwork...

8 years ago | 0

| accepted

Answered
How do I replace certain values of a vector A that are greater than certain values of a vector B for the values this vector?
>> A = [9,2,3;4,5,6;1,1,8]; >> B = [2;3;9]; *Method ONE:* for MATLAB versions R2016b+ with <https://blogs.mathworks.com/...

8 years ago | 1

Answered
Load function "unknown command option" while used in for loop+ while double clicking a file in matlab
_"Anyone knows why this happens?"_ Because the leading |'-'| character in the filename means that it is not a valid filename....

8 years ago | 0

Answered
How to select element in cell array, based on non-zero entries in another vector?
Just use basic logical indexing: >> a = [1,0,0,1]; >> b = {'ada', 'bob', 'carl', 'dana'}; >> c = b(a==1) c = ...

8 years ago | 1

| accepted

Answered
settings values of radio buttons in GUI
Depending on how your code works, you could use one of these two methods. Both of them let you set an arbitrary variable in each...

8 years ago | 0

| accepted

Answered
How to convert this .mat file to .xls or.dat file?
Your |.mat| file contains a 3x2 cell array, each cell of which contains a 1x9 numeric array: this data cannot be saved in a 2D a...

8 years ago | 0

| accepted

Answered
How can I save functions or sub functions in matlab?
It is not clear from your explanation _where_ you are defining the function, but I can see two main possibilities which would ge...

8 years ago | 0

| accepted

Answered
A quoted character vector is unterminated ! what does this mean?
MATLAB does not implicitly continue a character vector onto a new line, like you are doing: 'abc def' This is a synta...

8 years ago | 0

| accepted

Answered
Reorder columns of a multidimensional table according to sort() results on an other one
Use <https://www.mathworks.com/help/matlab/ref/sub2ind.html |sub2ind|>: >> [newA,idr] = sort(A,1); >> S = size(A); >>...

8 years ago | 0

Answered
Why do i get error message "Dimensions of arrays being concatenated are not consistent."
The line break in the middle of the vector is interpreted as a new row of the matrix. If you do not want this then use an ellips...

8 years ago | 0

Answered
how to solve undefined function or variable
|progressbar| is not an inbuilt MATLAB function, so you either need to have gotten it from someone else, or written it yourself....

8 years ago | 0

| accepted

Answered
maximum value of numerical pattern
>> A = [1 1 1 2 2 2 3 3 3 3 4 4 4 4 4]; >> B = [1 2 3 1 2 3 1 2 3 4 1 2 3 4 5]; >> C = unique(A) C = 1 2 3 ...

8 years ago | 2

| accepted

Answered
sorting in descending order by row
Where |M| is your matrix: >> M = randi(9,4) M = 6 1 9 5 5 1 8 8 6 4 9 9 6 3 ...

8 years ago | 0

| accepted

Answered
How can I convert a cell array with values {'S101' 'S102'},to a double array?
Making some assumptions: >> events = {'S100';'S102';'S103';'S101'}; >> str2double(strrep(events,'S','')) % easy ans =...

8 years ago | 0

| accepted

Answered
How can i replace a line form a text ?
You can easily match those lines using a regular expression. Something like this: fmt = sprintf('\\s*%c\\s*=\\s*(\\d+\\.\\d...

8 years ago | 0

| accepted

Answered
A(B)=[] in anonymous function
_"A(B)=[] in anonymous function"_ This is not possible: anonymous function do not allow allocations. But you can use indexing...

8 years ago | 0

| accepted

Answered
Error in plotting Cost Function as a function of iterations
You used the wrong index here: J_list(num_iters) = = costFunction(...) the index should be |i|.

8 years ago | 0

| accepted

Answered
Takes two integer valued vectors, decide if a is the inverse of eachother.
* Using |input| means that the actual function input arguments are ignored. * While you do use a loop as the question requests,...

8 years ago | 0

Answered
Save data sets in different places
The mistake that both you and Image Analyst made is to use _command syntax_, whereas you need to use _function syntax_ like this...

8 years ago | 0

| accepted

Answered
what is the single command?????????
R = 100; % rows C = 12; % columns N = 5; % number of 1's. cmb = nchoosek(1:C,N); % all unique column combinations...

8 years ago | 2

| accepted

Answered
how to add a header to a text file ?
One problem is that your <https://www.mathworks.com/help/matlab/ref/fprintf.html |fprintf|> format string contains lots of the _...

8 years ago | 0

Answered
Problem with non-existent variables
Your concept is fine, but you need to read the <https://www.mathworks.com/help/matlab/ref/isfield.html |isfield|> help and use i...

8 years ago | 0

| accepted

Answered
True pre-allocation of structure array?!
_" MATLAB does not truly allocate the memory for all the frames,"_ And nor should it! _"Would there still be a benefit in ...

8 years ago | 1

Answered
How can i access one cell {1x1} to split/separate its contained value?
Here is a simple solution using <https://www.mathworks.com/help/matlab/ref/regexprep.html |regexprep|>: >> str = fileread('...

8 years ago | 0

| accepted

Answered
Help with set function, 'CloseRequestFunc' and Calling variables out of the function.
One easy solution is to use a <https://www.mathworks.com/help/matlab/matlab_prog/nested-functions.html nested function> (will no...

8 years ago | 0

| accepted

Answered
I need help in arranging my data
The simplest solution is to use <https://www.mathworks.com/help/matlab/ref/sortrows.html |sortrows|>. Your real data (attached) ...

8 years ago | 0

| accepted

Answered
From a vector to a 3D array
A simple |reshape| gives the exact order that you request: >> mat = reshape(vector,[6,5,4]) mat(:,:,1) = 0.35315857...

8 years ago | 1

| accepted

Answered
how can i rotate a figure without using the figure window but using code
Use <https://www.mathworks.com/help/matlab/ref/view.html |view|>, e.g. view(180,90)

8 years ago | 1

Answered
indexing a vector in a loop
This is much simpler and more efficient that your idea of magically accessing variable names. I simply <https://www.mathworks.co...

8 years ago | 0

Load more