Answered
Help using textscan on a .dat file
Either just use *fgetl* on each line and test for the end line characteristic string, parsing each line and building the arrray ...

11 years ago | 0

Answered
How to create a series of variables of data?
What error(s), specifically are you getting (iow, what _precisely_ what does "not working" mean? It's somewhat simpler imo to...

11 years ago | 0

| accepted

Answered
How to remove unwanted X from Xdata
idx=find(B2>=0.25,1,'last'); plot(A2(1:idx),B2(1:idx))

11 years ago | 1

| accepted

Answered
Convert Integer Array to Binary Array
Using builtins w/o mod/rem to separate digits... >> dec2bin(str2num(sprintf('%d',x).')) ans = 011 010 001 111 110 01...

11 years ago | 2

Answered
How can i reshape a 20370x1 matrix into 2037x10x1?
All arrays in Matlab have implied but not explicit unity dimensions in higher dimensions; you can refer to the array with the th...

11 years ago | 0

Answered
Why does uigetfile return a different data type for filename depending upon the number of files selected?
Why? "Because" is the only answer that matters. It _is_ documented behavior. While it is something of a pit(proverbial)a(pp...

11 years ago | 2

| accepted

Answered
Overwriting a vector to a specific location into CSV file
If you have the spreadsheet 'Sheet1', use *xlswrite*. You can't do this directly in a .csv file without dealing with a lot of i...

11 years ago | 0

| accepted

Answered
Plotting with 2 different axes but same scale
OK, what I'd probably do is start with *plotyy* and save the handles to the two axes so you can more easily modify them a little...

11 years ago | 0

Answered
xlabel in box plot
Like text([2.5:4:12].',-0.1*ones(3,1),['X';'Y';'Z'],'horizontal','center') maybe?

11 years ago | 1

Answered
I am getting an error "Cell contents reference from a non-cell array object"
The short answer is don't use the curly braces around the '1' but what is MVF intended to be? The LHS variable name makes it lo...

11 years ago | 0

Answered
Ingesting fractional second timestamps
I think you're mistaking the happenstance of the value with the formatting--Matlab will import the full precision of the value a...

11 years ago | 0

| accepted

Answered
How do I create a legend that explaines scatter plot by marker size
"Use the handles, Luke..." :) If you save the handles to the scatter points, you can write a legend for those specific poin...

11 years ago | 0

Answered
How to reorder legend items individually in plotyy in a subplot
From help legend ... legend(H,string1,string2,string3, ...) puts a legend on the plot containing the handles i...

11 years ago | 0

Answered
Can I download built-in Matlab functions somewhere?
Nope, only upgrading to a release which includes it (or, in some cases, there are File Exchange submissions which provide the fu...

11 years ago | 1

| accepted

Answered
How to call a function with a char variable
Don't do this!!! Use *save/load* or some other form instead. If you think you really, really _must_ do this for some reason,...

11 years ago | 0

| accepted

Answered
how to overwrite a certain value in input file(inp)
The short answer is "you can't" -- sequential files are, well, "sequential"; whatever you write other than appending to the end ...

11 years ago | 0

Answered
Help plotting two y labels
How about instead of using another axes and futzing with *legend* hTx1=text(18,-0.2,'Downwelling','horizontalalign','right'...

11 years ago | 0

| accepted

Answered
Why does it appear "Error: Function definitions are not permitted in this context" when I run the following function file?
As the error says, you can't directly execute an m-file which defines a function; you _Call_ the function from a script or anoth...

11 years ago | 1

| accepted

Answered
edit txt file but save previous data
_" If filename is the name of an existing text file, then writetable overwrites the file."_ You can't with it. Since *writet...

11 years ago | 0

| accepted

Answered
Cycle line type before color type on plot?
I don't believe that level of customization is available--you can change the line and color orders but don't believe there's any...

11 years ago | 0

| accepted

Answered
Does Matlab resize vectors automatically
Yes, Matlab automagically reallocates storage on assignment any and every time it needs to. This includes, obviously, the chang...

11 years ago | 1

Answered
Matrix operation without for loop
>> T=ones(3); >> a=1:3;a=a(:); >> out=bsxfun(@rdivide,T,a) out = 1.0000 1.0000 1.0000 0.5000 0.5000 0...

11 years ago | 0

| accepted

Answered
Saving multiple output in one variable from loop
OK, as per the comment, firstly, you're computing the _n_ moving average m*n times...move it out of the loop over which it's inv...

11 years ago | 0

| accepted

Answered
dlmread with ^ as delimiter
_"Trouble reading number from file (row 1u, field 1u) ==>rssd9999^rssd9001^BHCK0081^BHCK0395^..."_ >> help dlmread dlmrea...

11 years ago | 0

Answered
How to find the sum of each element of a matrix?
If _x_ is the array, xsum=sum(x(:)); % ":" is a Matlab idiom that returns all elements in a column vector

11 years ago | 1

| accepted

Answered
Plot two Y-Axis, multiple lines on the second from line-fitted points and call out only the fitted lines in the legend
_"I cannot use plotyy because these are points."_ Of course you can... [hA,hL,hR]=plotyy(x1,y1,x2,y2,@plot,@scatter); ...

11 years ago | 0

Answered
How to convert string to filename when MATLAB is unable to identify the file ext?
Your first attempt will create a filename that has '...spot 1\0\\.raw' as the ending string which, I'm sure isn't the file name...

11 years ago | 0

Answered
Write a matrix of strings to text file:
_" I get error "Error using fprintf Function is not defined for 'cell' inputs."_ Yes. Cast the cell content to char() when w...

11 years ago | 0

Answered
MATLAB generated m-code's importdata function
It's not clear how many of the blank lines are fignewtons of the display/posting formatting and how many are real; the count of ...

11 years ago | 0

Answered
Using reshape to get a block averaging of data when it is not divisible by the block?
Just use modulo arithmetic to compute the block size and remainder... L=size(x,1); % array length N=n*fix(L/n); % N ...

11 years ago | 0

Load more