Answered
How to turn on the function hint?
Syntax hinting and function completion are available in both the Command Window and Editor, and are on by default: <http://ww...

11 years ago | 4

| accepted

Answered
How to write smart coding ?
Don't do this. Putting lots of input and output arguments like that is untidy and buggy programming, and <<http://www.mathworks....

11 years ago | 1

| accepted

Answered
Save values in a 2d matrix corresponding to coordinates
You need a way to convert decimal values to a list of indices. One easy way to do this is to use <http://www.mathworks.com/help/...

11 years ago | 1

| accepted

Answered
Is there a simple way to reference months from data in matlab time?
You do not provide any sample data for us to work with, which means we have to invent our own. Try this: % Sample data and ...

11 years ago | 1

Answered
Loading and saving sequence of files?
Although beginners love making variable magically pop into existence in their workspaces, it is more robust to explicitly alloca...

11 years ago | 1

Answered
How to refer a high dimension matrix
This is exactly what <http://www.mathworks.com/help/matlab/ref/sub2ind.html |sub2ind|> is for, it generates the linear indices c...

11 years ago | 2

| accepted

Answered
Experts of MATLAB, how did you learn? Any advice for beginner/intermediate users?
I reject the label "expert", but here is my two cents worth anyway: MATLAB Specific: MATLAB has a great feature that very few ...

11 years ago | 140

| accepted

Answered
Appending one cell array to non-zero cells of another
Using <http://www.mathworks.com/help/matlab/ref/cellfun.html |cellfun|> and <http://www.mathworks.com/help/matlab/ref/num2cell.h...

11 years ago | 0

| accepted

Answered
Manipulating cell arrays based on index
_"However, for a cell array, I cannot"_ Of course you can! Cell array indexing is covered here, and is well worth reading: ...

11 years ago | 0

| accepted

Answered
Get indices from accumarray
The fastest that I could come up with is to avoid |accumarray| and stick with loops only... about ten times faster on my compute...

11 years ago | 2

| accepted

Answered
Get indices from accumarray
Basically we need a way to get the |max| indices... one option is to get them explicitly (although I make no claim about whether...

11 years ago | 1

Answered
How to write a value on a specific portion which is constant on a graph?
Try this: a = [1,2,2,2,2,2,2,2,2,2,3,5,5,5,5,5,5,5]; b = 1:numel(a); % d = [1,diff(a),1]; % differences between...

11 years ago | 1

| accepted

Answered
Removing the string from cell array
Use <http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ indexing to access or remove elements of a cell...

11 years ago | 1

Answered
loading mixed data (csv format) using Textscan
Here is one way that uses <http://www.mathworks.com/help/matlab/ref/regexprep.html |regexprep|> to remove the commas from number...

11 years ago | 0

| accepted

Answered
Load .mat - file to base workspace?
Although beginners love making variables pop into existence in different workspaces, this is not robust programming, it is slow,...

11 years ago | 3

| accepted

Answered
What is wrong with this code?
The basic problem is that you are trying to assign vectors to columns of |locs| or |pks|, but they have a different number of ro...

11 years ago | 1

| accepted

Answered
Subscript indices must either be real positive???
Like a lot of mathematics, MATLAB indexing starts at one. On the first loop the value of |del_hat_xi| is zero, which gives the e...

11 years ago | 1

| accepted

Answered
how to convert 1100111 to 1 1 0 0 1 1 1
If |a| is a numeric column vector, then you can simply use <http://www.mathworks.com/help/matlab/ref/num2str.html |num2str|> lik...

11 years ago | 3

Answered
using fread() to read part of a file
The documentation for <http://www.mathworks.com/help/matlab/ref/fread.html |fread|> states that _"fread populates A in column or...

11 years ago | 1

| accepted

Answered
Write a matrix of strings to text file:
Try this: vect_signals = {'T', '211A015', '211B035', '211A101', '211B111', '211N401', '211D411',... '21411A151', '21...

11 years ago | 1

| accepted

Answered
matlab cant be installed on mac
A search of MATLAB Answers for "Yosemite" brings up 179 hits: http://www.mathworks.com/matlabcentral/answers/?term=Yosemite&t...

11 years ago | 2

| accepted

Answered
how to program to check the sequence 0<alpha1<alpha2<alpha3<alpha4<pi/2
MATLAB supports binary <http://www.mathworks.com/help/matlab/ref/relationaloperators.html relational operators> only, so one can...

11 years ago | 1

| accepted

Answered
How can I print multiple text blocks containing numerical values of a matrix with the fprintf command?
The way you are creating |NodeID| is very inefficient: learn about <http://www.mathworks.com/help/matlab/matlab_prog/vectorizati...

11 years ago | 0

Answered
Merge 3D matrices into one cell array without using a loop
Try this: A = rand(10,10,300); B = rand(10,10,300); C = rand(10,10,300); D = permute(cat(4,A,B,C),[3,4,1,2]); % jo...

11 years ago | 0

| accepted

Answered
Can I join variables containing strings into one variable?
Try this: >> X = {'Apple','Orange','Banana','Fruit'}; >> Y(2,:) = X; >> Y(1,:) = {' + '}; >> [Y{2:end}] ans = ...

11 years ago | 0

Answered
working of surf function
<http://www.mathworks.com/help/matlab/ref/surf.html |surf|> needs matrices to plot this data, so you need to convert the two vec...

11 years ago | 0

Answered
save(filename, var) cant find workspace variable even if it exist
The error message and the quoted code code give two different variable names: |'NewTest'| vs |'newTest'|. Capitalization is s...

11 years ago | 2

| accepted

Answered
Error while using xlswrite
For more robust and portable code you should use <http://www.mathworks.com/help/matlab/ref/csvwrite.html |csvwrite|> or <http://...

11 years ago | 0

Answered
Keeping the same order in arrays - Brain Teaser?
Try using a <http://www.mathworks.com/help/matlab/matlab_prog/access-multiple-elements-of-a-nonscalar-struct-array.html non-scal...

11 years ago | 0

| accepted

Answered
Change the name of csv file and save into a folder.
To rename a file use <http://www.mathworks.com/help/matlab/ref/movefile.html |movefile|> (yes, really!): movefile('oldname....

11 years ago | 1

| accepted

Load more