Answered
Extracting values from an excel sheet using textscan
<http://www.mathworks.com/help/matlab/ref/textscan.html |textscan|> works okay on that sample file. If you are having problems p...

11 years ago | 0

Answered
Matrix to be printed to a text file
The problem are your |NaN|'s, which you wrote as |Nan|, not |NaN|. Character case is important in MATLAB! Here with |Nan|: ...

11 years ago | 0

| accepted

Answered
converting matrix to array
Use <http://www.mathworks.com/help/matlab/ref/transpose.html |transpose|> and <http://www.mathworks.com/help/matlab/ref/reshape....

11 years ago | 3

Answered
How to display the celcius sumbol (°C) using fprint??
Here are four methods: fid = fopen('temp.txt','wt'); fprintf(fid,'symbol one: °C\n'); fprintf(fid,'symbol two: %cC\n',176...

11 years ago | 4

| accepted

Answered
sort a matrix in a specific way
You can use <http://www.mathworks.com/help/matlab/ref/sortrows.html |sortrows|> for this: >> A = [12,0,1,65; 5,1,0,340; 13,...

11 years ago | 0

| accepted

Answered
Value in x-axis and y-axis not display same as data
Actually those values are exactly the same as the data, except that the GUI arrangement obscures the exponential multiplier. Her...

11 years ago | 1

| accepted

Answered
Question about taking data from a .txt file
There is no need to use any slow loops for this, when |regexp| does it all in one go: fmt = '(^Room \d+)\s*\n(^- \d+ [^\n]+...

11 years ago | 0

Answered
How to extract specific data from a matrix?
You can use <http://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html indexing> to access any subset...

11 years ago | 0

| accepted

Answered
How to extract variables from Character array
Thank you for editing your question and making it clearer. You can use <http://www.mathworks.com/help/matlab/ref/regexp.html ...

11 years ago | 3

| accepted

Answered
How do you set a default reference for structure fields.
You could use <http://www.mathworks.com/help/matlab/ref/struct2cell.html |struct2cell|> and <http://www.mathworks.com/help/matla...

11 years ago | 2

Answered
A simple string to Hexadecimal value
Here are three easy methods, using <http://www.mathworks.com/help/matlab/ref/sprintf.html |sprintf|> is the fastest: >> spr...

11 years ago | 0

Answered
Changing large matrices by not completely loading them into memory
You should read TMW's own advice on working with big data: http://www.mathworks.com/discovery/big-data-matlab.html And in ...

11 years ago | 1

Answered
create structure variable within loop using strings??
This is easy with a bit of help from the documentation, but first we have to understand that these are two separate operations t...

11 years ago | 1

Answered
These are my inputs how can i use str2num in title so that i can display the values of inputs?
It is more much robust to use the |'s'| option for <http://www.mathworks.com/help/matlab/ref/input.html |input|>, which can be u...

11 years ago | 0

Answered
Finding the address of an element in a multi-dimensional array
It is easy to create a function that will return the subscript indices in a vector: function vec = ind2vec(siz,ndx) tmp ...

11 years ago | 0

| accepted

Answered
Add header to dat file
Although it is not clear what your data source is (are you reading from a file, or from variables in MATLAB's memory?), you coul...

11 years ago | 1

Answered
How to export matrices with a specific format to .txt?
Without any sample data to try out this is rather difficult to help you, but you can try this code (I created sample data based ...

11 years ago | 0

Answered
How to convert cell array to structure array
Here is a short and reasonably tidy way of doing this using <http://www.mathworks.com/help/matlab/ref/struct.html |struct|>: ...

11 years ago | 0

Answered
What kind of matrix multiplication algorithm is used in MATLAB?
The purpose is explained here: http://www.mathworks.com/help/matlab/matlab_prog/vectorization.html MATLAB uses <https://en...

11 years ago | 1

| accepted

Answered
how to find the element which is greater than or equal to its row and smaller or equal to its column in a matrix
Copying code from the internet is not always a good way to learn best-practice coding: Solving this problem using loops misses u...

11 years ago | 2

| accepted

Answered
conversion of [h,m,s] to h:m:s
You can easily convert the numeric array to a <http://www.mathworks.com/help/matlab/characters-and-strings.html character array>...

11 years ago | 0

| accepted

Answered
??? Undefined function or variable 'swap'.
There is no need to write your own function: if you want to swap variables, then you can use the inbuilt <http://www.mathworks.c...

11 years ago | 2

Answered
Copy and paste data in the same CSV file using matlab
*Method One* Hard-coded replication of rows (twice in this example): >> X = [0.0,0.82; 2.1,0.72; 4.2,0.68; 6.3,0.15]; >>...

11 years ago | 0

| accepted

Answered
Write a function that checks whether an element occurs in a list.
Actually your code just needs the addition of <http://www.mathworks.com/help/matlab/ref/any.html |any|> to work correctly: ...

11 years ago | 1

Answered
How to read a .txt file?
For faster and neater code you can use <http://www.mathworks.com/help/matlab/ref/textscan.html |textscan|>, which also converts ...

11 years ago | 0

Answered
Write specific data of the specific lines of a text file into a matrix
This code reads the whole file as one string, then performing some string replacement operations to allow <http://www.mathworks....

11 years ago | 0

Answered
How can I have the numbers in one vector after a while loop?
Although it is slightly different in operation, you could try this: A = [1 0 5 4; 2 0 5 4; 3 4 6 2]; N = sum(A(:)); X...

11 years ago | 0

| accepted

Answered
I have a surface and I want to plot peaks on the 3D surface in matlab
That data is actually arranged in sets of three, like it was in a matrix that was then flattened out. So if we convert it back i...

11 years ago | 0

Answered
I have a matrix read from a text file and I want to subtract more matrix, delimited by the repeating line: 9999 0 0 0 0 0. I want to have as a result 5 different matrix, in this case. How can I do? thank you
EDIT: to use the newly uploaded data file. Probably the easiest way to split this would be to do this after reading the file ...

11 years ago | 0

| accepted

Load more