Answered
convert a html table to csv format
As Matt mentions, Python + package would be perfect for this part. Here is one way to do it using REGEXP in MATLAB.. not the ful...

13 years ago | 0

Answered
Edit line in text document
If you want to change part of a line based on a match (checkstr), a good way to achieve this is to use regular expressions, e.g....

13 years ago | 2

| accepted

Answered
Index exceeds matrix dimensions.
length(data8(:,1)) is evaluated only once at the beginning of the FOR loop. It is e.g. 10. Then you remove rows from |data8|...

13 years ago | 0

| accepted

Answered
Plz explain the operation
CELLFUN is called with two arguments: an anonymous function, and a cell array. It applies the anonymous function to each element...

13 years ago | 0

| accepted

Answered
need help splitting a long series of data with date headers
This question is more tricky than it really appears. The reason is that you can have months, days, and hours I guess, on one or ...

13 years ago | 0

Answered
How to increment string
fname = sprintf('filename(%d).jpg', m) ; saveas(C, fname) ;

13 years ago | 0

| accepted

Answered
plotting a single vector out of a multidimensional array?
You have two singleton dimensions when you index |Xhat(1,3,:)|. Look at the following: >> A = rand(2,3,4) ; >> v = A(1,2...

13 years ago | 4

| accepted

Answered
[Effective Coding] for loop
You could go for a variation of the following (EDITED): >> TIT2(1) + sum(diff(TIT2) == 1) ans = 3 PS: I assumed ...

13 years ago | 0

Answered
Are you using "Accept an answer to a question (7 days after the question was asked)"?
Thank you all for your input (including Wendy who posted <http://www.mathworks.com/matlabcentral/answers/42263-when-to-accept-an...

13 years ago | 3

Answered
splitting a array at defined interval
Alternatively: loc = find(c >= 10) ; vind = c(loc) ; c(loc) = [] ; out = mat2cell(c, 1, vind) ;

13 years ago | 1

| accepted

Answered
two matrix in one, condition...matlab
>> [C,ia,ib] = intersect(A(:,1:2),B(:,1:2),'rows') ; >> result = [C, A(ia,3), B(ib,3)] result = 1 10 3 16 ...

13 years ago | 0

| accepted

Question


Are you using "Accept an answer to a question (7 days after the question was asked)"?
Dear all (who have a 500+ rep), &nbsp;&nbsp;&nbsp;&nbsp;I was wondering about your take on this mechanism (possibility to acc...

13 years ago | 4 answers | 3

4

answers

Answered
How to reorder cell array columns based on the order of a vector matrix, while keeping rows intact in Matlab?
Would this work? >> buffer = arrayfun(@(rId) data(rId,order(rId,:)).', 1:size(order,1), ... 'UniformO...

13 years ago | 0

| accepted

Answered
remove negative cells in a matrix by averaging
See my comment below your question and note that none of the solutions below solves the problem of managing cases where the aver...

13 years ago | 0

Answered
how to give color to an output text
Use a combination of FPRINTF and CPRINTF, without outputting CR/LF before the "final" end of line. >> fprintf('This is a ') ...

13 years ago | 2

| accepted

Answered
how can i eliminate NaN and Inf from a matrix please help me thanks a lot
Technically: >> lamda(isnan(lamda)) = 234 lamda = 234 0 0 0 0 0 0 0 0 0 234 ...

13 years ago | 2

Answered
Unique Function based on 2 columns [Instead of rows]
*NEW ANSWER AFTER 2ND EDIT* You could do it as follows (you might want to fine tune it): diff(find([true; any(diff(a{1}(:...

13 years ago | 1

| accepted

Answered
How to find biggest element of the array?
MAX works along a specific dimension (that you can specify using an extra arg). One way to find the overall max is to index |A| ...

13 years ago | 0

Answered
Storing Multiple Matrices from a For Loop
You can use a cell array, e.g n = 10 ; M = cell(n, 1) ; for k = 1 : n M{k} = 20*k + rand(10) ; end you can see...

13 years ago | 46

| accepted

Answered
joining two arrays to make a longer one
If all vectors are column vectors, do the following: data = [] ; for f = 1 : nFiles % Load file f: % ... whate...

13 years ago | 1

Answered
Reading multiple text file and saving in corresponding excel format after removing headers.
If you want to keep obs var1 var2 var3 var4 var5... as a header (one row of columns header), you can perform the fol...

13 years ago | 0

| accepted

Answered
Function Variable to update workspace variable
You can use both EVALIN and ASSIGNIN, but I would not recommend this; why not simply using an output argument? E.g. eeg = ....

13 years ago | 0

Answered
select certain rows of a matrix dased on which data their elements are from
You almost did it; the expression data(:,6)>=StartDate & data(:,6)=<EndDate should be ( |=<| is not a relational operator...

13 years ago | 1

| accepted

Answered
How to count unique value in array?
You could build something around the following example: >> b = a([diff(a)~=0, false]) b = 2 1 3 2 1 ...

13 years ago | 1

Answered
Vector Function to calculate grades
Assuming that my comment above is valid and that the full matrix of point is |P|, you can get the sum of points per student as f...

13 years ago | 0

| accepted

Solved


Generate a NaN...on purpose
The goal is to create a function that will return a single "NaN" without using the nan function. I am interested to see how many...

13 years ago

Answered
Extracting number from output file
>> buffer = fileread('data.txt') ; >> loc = strfind(buffer, 'SCF Done: E(RB3LYP)') ; >> value = sscanf(buffer(loc+22:end), ...

13 years ago | 0

Answered
Read matrix from a txt file after a specific expression
You should use TEXTREAD with the |'heaerlines'| parameter set to the number of lines (e.g. 3) that characterizes your header. ...

13 years ago | 0

| accepted

Answered
How to write cell array into a csv file
To write the data in C to a CSV file. Use “writetable” in combination with the “cell2table” function. % Convert cell to a tabl...

13 years ago | 28

| accepted

Answered
3D array - Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Look at the size of |cellDist|, it is probably not a&nbsp;&nbsp; |cellNum x cellNum| &nbsp;&nbsp;array.

13 years ago | 0

Load more