Answered
How to create this specified matrix?
One fast and easy way is to use <http://www.mathworks.com/help/matlab/ref/toeplitz.html |toeplitz|>, it only needs one line of c...

10 years ago | 0

| accepted

Answered
What is the latest optimization techniques available in the Matlab right now?
<http://www.mathworks.com/help/matlab/optimization.html> <http://www.mathworks.com/products/optimization/>

10 years ago | 0

Answered
How to reset 'DefaulAxesColorOrder' and 'DefaulAxesLineStyleOrder' to original settings
Here are some solutions: # restart MATLAB. # before |set|-ting the values, |get| the current ones. # use |get(0,'FactoryAxe...

10 years ago | 2

| accepted

Answered
Using regexp to create dataset
fmt = [repmat('%f',1,10),'%q','%f']; opt = {'CollectOutput',true, 'Delimiter',',', 'TreatAsEmpty','NA'}; fid = fopen('te...

10 years ago | 0

| accepted

Answered
Function Counter of digits
Assuming only *text files*, then here is one line to solve your task: nnz(isstrprop(fileread(...),'digit')) just replace ...

10 years ago | 0

| accepted

Answered
How to select the remainding elements from a vector that don't fit a criteria?
Have a play around with <http://www.mathworks.com/help/matlab/ref/ismember.html |ismember|> and indexing: >> V1 = [1 2 3 4 ...

10 years ago | 0

Answered
How to join two numeric arrays into a single string?
The correct solution is to first concatenate the matrices (and because you have column matrices you also need to transpose): ...

10 years ago | 1

Answered
Different result when adding variables
You are doing two different operation sequences, so why the surprise that you get two different results? *First Case* >>...

10 years ago | 0

| accepted

Answered
How transform a vector into a Matrix
Use <http://www.mathworks.com/help/matlab/ref/reshape.html |reshape|>: >> V = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]; ...

10 years ago | 4

| accepted

Answered
Colorbar degree symbol (。) problem
<http://www.mathworks.com/matlabcentral/answers/32376-degree-symbol> <http://www.mathworks.com/matlabcentral/newsreader/view_...

10 years ago | 0

Answered
How to compare each content of string which is of type double (matrix) in if loop recursively?
You are making this far too complicated. Trying to detect which matrix is being processed in each loop iteration is totally unne...

10 years ago | 0

| accepted

Answered
joint find statement using ismember & ~ismember
It works fine for me, using your sample data: >> ID = [1;2;20]; >> IDA = [1;2;40]; >> DateID = [729115;729206;729298]...

10 years ago | 0

| accepted

Answered
How can i combined array automatically
>> tmp = a(:)*ones(1,numel(a)); >> Tx = tmp(tril(true(numel(a)))) Tx = 100 125 150 175 200...

10 years ago | 1

| accepted

Answered
How to create a random matrix that contains only of 0's, 0.5's and 1's?
>> randi([0,2],5,5)/2 ans = 0.5 1 0 0 0 0.5 1 ...

10 years ago | 0

| accepted

Answered
Minimum positiver real number.
Use logical indexing first: >> d = [73 -1.07 1.08 0.01]; >> min(d(d>0)) ans = 0.01

10 years ago | 1

| accepted

Answered
Read all fields of a GUI in ONE step
The command <http://www.mathworks.com/help/matlab/ref/get.html |get|> accepts an array of handles, and will return all of their ...

10 years ago | 0

| accepted

Answered
delete a struct in a struct array
>> idx = ~cellfun('isempty',{a.places}); >> b = a(idx)

10 years ago | 0

| accepted

Answered
What is 'esp'? a function? What it is meaning?
I suspect that it is a spelling mistake: <http://www.mathworks.com/help/matlab/ref/exp.html |exp|>.

10 years ago | 1

Answered
How to use two colormaps for different levels of my signal in contour plot?
With |contour| there is no such thing as |CData| as there is for |surf| and the like, so the colors are simply mapped/scaled to ...

10 years ago | 0

Answered
For-Loop with Regexp results in empty elements, not just the matches? How to loop only the matches?
>> varargin = {'test.ppt','blah.pptx','false.txt'}; >> C = regexpi(varargin,'^.+\.(ppt|pptx)$','match','once'); >> for k...

10 years ago | 1

| accepted

Answered
Repeat element n for m times with n,m=vectors
>> val = [1,2,3,4]; >> rep = [4,1,2,3]; >> C = arrayfun(@(v,r)repmat(v,1,r),val,rep, 'UniformOutput',false); >> Z = [...

10 years ago | 1

| accepted

Answered
How to convert a 3D matrix into 2D matrix?
Use <http://www.mathworks.com/help/matlab/ref/reshape.html |reshape|>. >> A = reshape(1:4*3*2,4,3,2) % array of size (4,3,2...

10 years ago | 0

| accepted

Answered
how to do leave-one-out cross validation of samples in cells
C = num2cell(1:50); *Method One: Colon Operator* N = numel(C); for k = 1:N ind = C{k} tmp = vertcat(C...

10 years ago | 0

| accepted

Answered
Convert a cell data into variable name
*Solution* It is trivial to convert the data into a <http://www.mathworks.com/help/matlab/structures.html structure>: >>...

10 years ago | 2

| accepted

Answered
How can I write it correctly ???
Y = 31 * ((1-X)./X) .^ (1/2.6) or as long as every element of |X| is less than or equal to one: Y = 31 * nthroot((1-X)./...

10 years ago | 0

Answered
How to rearrange a matrix in a preferred order
Some basic MATLAB <http://www.mathworks.com/help/matlab/math/matrix-indexing.html indexing> does the trick: >> old = randi(...

10 years ago | 1

| accepted

Answered
Optimize based on on max min of columns
With MATLAB using a loop to solve this is a waste of time. Try something like this: >> A = [80 7.5 1000 0.5;120 500 3000 1;...

10 years ago | 0

Answered
'For' loop for specified integers (more than one)
The simplest solution is to use indexing: X = [1,2,3] Y = [0,1,2]; A = [0.2,2,20]; for k = 1:numel(A) x = X(k) ...

10 years ago | 0

Answered
how can I change code to rid a for loop in favour of vectorisation in hard example
Here is a simple vectorized solution using <http://www.mathworks.com/help/matlab/ref/hankel.html |hankel|> and <http://www.mathw...

10 years ago | 1

| accepted

Answered
concatenation from 2 differents cell arrays
You don't give sizes of |bloc_base| and |bloc_fix|, but for your cell arrays (?) you could try something like this: C = [blo...

10 years ago | 1

| accepted

Load more