Answered
how to properly rename files like pic0001 while keeping their order
If I understand it correctly you might have the following situtation: % example filenames where filenames = {'file1.bmp'...

13 years ago | 1

Answered
How to find and replace an entire word in a cell array
In this case you can simply use <http://www.mathworks.co.uk/help/matlab/ref/unique.html |unique|> array1 = {'h1' 'h2' ...

13 years ago | 0

| accepted

Answered
Circular indexing of an array
I have something different, a vectorized approach: X = 1:10; shift = 1; B1 = (circshift(X,[1 shift]) + X)/...

13 years ago | 2

Answered
Calculating Mean of Matrices
Then create one array |loc|, which will have the usual n by m dimension but you will be adding slices in a loop on the third d...

13 years ago | 0

Answered
Plot a timeseries from array of dates
Convert each column into a proper numeric date: datenum(timelist') *EDIT* datetick('x')

13 years ago | 0

| accepted

Answered
Importing data using textscan in one array instead of multiarrays
Answering in order: A) You cannot mix datatypes except in cell array which will wrap the content. However, I do not advice to...

13 years ago | 0

| accepted

Answered
Econometrics Toolbox VAR Model Case Study - which data for model specification?
Discrepancy in the documentation as proved by the graph <<http://www.mathworks.co.uk/help/econ/vgxplot.png>> which is gene...

13 years ago | 0

| accepted

Answered
How do I set the same color scheme for two different plots?
Use <http://www.mathworks.co.uk/help/matlab/ref/caxis.html |caxis|> to set a fixed color scale pcolor(f) caxis([0,200]) ...

13 years ago | 1

| accepted

Answered
How open files with quotation marks? or how to remove the quotation mark?
Use nom{i} The curly brackets are used to access the content of cell arrays. Round brackets on cell arrays select the co...

13 years ago | 1

| accepted

Answered
multiplying/dividing matrices that contain string variables and NaN
Using the same approach from my answer to your previous post: % First extract only the data Bdata = cell2mat(B(2:end,:))...

13 years ago | 1

Answered
multiplying two matrices in an efficient way
squeeze(sum(bsxfun(@times, reshape(B,20,2,[]),A),2))

13 years ago | 1

| accepted

Answered
function acts differently in command window to when its run in a .m file.
As the error message suggests, one of the inputs to the |exist| function is probably a cell type. In the cmd window type ...

13 years ago | 0

Answered
offline viewing of recorded webinars
Unfortunately you can't download them. http://www.mathworks.com/matlabcentral/answers/3394#answer_5104

13 years ago | 1

| accepted

Answered
advanced sorting of cell array of strings
Your sample input: files = { 'a_20_15rpm_05.txt' 'a_20_14rpm_05.txt' 'a_20_12rpm_50.txt' 'a_20_12rp...

13 years ago | 1

Answered
Going from 1 x n to n x n matrix
repmat(A,100,1) where |A| is your vector.

13 years ago | 2

| accepted

Answered
I have 26 ascii files and I want to import data from all these files with the help of a for loop and convert all of them into column vectors.
You're overwriting |B| on each iteration. I suggest to modify as follows: for k = 1:numel(files); B(k) = importda...

13 years ago | 1

Answered
program- debug!! help.
<http://www.mathworks.co.uk/help/matlab/matlab_env/debugging-process-and-features.html Debugging process and features> A brie...

13 years ago | 2

Answered
Boxplot - Arrangement of box labels
Problem NOT solved, but documented. It's a BUG: http://www.mathworks.co.uk/support/bugreports/details.html?rp=228710

13 years ago | 2

| accepted

Answered
Adding Data to a structure
A reduced example, try to port it to your case: columnHeadings = {'Reading' 'Station'}; % Preallocate structure a(1...

13 years ago | 0

Answered
multiply along
sum(cumprod(A))

13 years ago | 1

| accepted

Answered
Help displaying a formatted matrix to the command window
Please read more carefully the documentation of <http://www.mathworks.co.uk/help/matlab/ref/sprintf.html |sprintf()|>, it DOES t...

13 years ago | 3

Answered
How to combine two matrices to one and sort the rows?
M_new = [M, n]; M_new = sortrows(M_new,6); See <http://www.mathworks.co.uk/help/matlab/ref/sortrows.html |sortrows()|> f...

13 years ago | 1

| accepted

Answered
Conditional Data Selection/Separation
I suggest to read the <http://www.mathworks.co.uk/help/matlab/index.html#language-fundamentals *Language Fundamentals*> and spec...

13 years ago | 2

| accepted

Answered
Matrix Simple Index Question
Sample inputs: m = 10; n = 13; A = rand(m,n); alpha = .38; Use logical indexing idx = A > alpha; A(id...

13 years ago | 3

| accepted

Answered
sort a vecrtor
Simply b(ind)

13 years ago | 2

| accepted

Answered
plots of dates
% Suppose you have the following cell array: dates = {{'22/02/09' '22/03/09' '19/04/09' '17/05/09' '12/07/09' '09/08/09' '0...

13 years ago | 1

| accepted

Answered
Issues with function Join
Try C=join(A,B,'key',{'x','v'},'Type','outer','MergeKeys',true);

13 years ago | 0

| accepted

Answered
Correlation nans
0/0 ans = NaN Since |corr(A, B) = cov(A,B)/(std(A) *std(B))| when you have that the two segments are all zeros, th...

13 years ago | 1

Answered
mahal function
Try mahal(double(x),double(y))

13 years ago | 1

Answered
plots - graphics quality poor
No antialis in MATLAB, altough you could use this submission: http://www.mathworks.com/matlabcentral/fileexchange/20979-myaa-my-...

13 years ago | 0

| accepted

Load more