Answered
Standardising errorbar whiskers
The length of the horizontal line for the whiskers is proportional to |[xdata(1) xdata(end)]| the range on the x-axis. In br...

14 years ago | 0

Answered
How to plot outputs from an equation with user inputs?
Let's say you have these two ranges: time1 = now-9; time2 = now; % And you want to create 100 equispaced points on th...

14 years ago | 0

Answered
How to plot error bars
Add this line at the end: opt = {'k','Linew',2,'LineS','none'}; x = 0.25:0.5:4.75; y = avg(1:end-1); errorbar(x,y,s...

14 years ago | 2

| accepted

Answered
How to exclude empty values from an array during statitical calculations?
Look at the function |<http://www.mathworks.co.uk/help/techdoc/ref/isnan.html isnan>|. A = [NaN; NaN; 1.14353917; 1.13195168;...

14 years ago | 1

| accepted

Answered
FINDING DETERMINANT OF MATRIX AFTER TAKING COVARIANCE
disp(Z) displays only a fixed number of significant digits depending on the |<http://www.mathworks.co.uk/help/techdoc/ref/f...

14 years ago | 0

Answered
How to generate and calculate with empty values of matrix-elements
You can write directly: NaN instead of 'NaN' but my suggestion would be to preallocate NaNs directly and delete the els...

14 years ago | 0

Answered
Problem by importing alpha numeric text files
Use |<http://www.mathworks.co.uk/help/techdoc/ref/textscan.html textscan>|: fid = fopen('c:\myfile.txt'); data = textscan(f...

14 years ago | 0

| accepted

Answered
How to choose overlapping data from two matrices?
Index the NaNs with |isnan|: idxa = isnan(a); idxb = isnan(b); Then combine the indexes with an or and negate it to ...

14 years ago | 0

| accepted

Answered
yahoo connection failed
It fails for me as well but try: conn = yahoo('http://download.finance.yahoo.com'); Could be related to a change Yahoo has m...

14 years ago | 1

Answered
if statement problem
You should use: Y(i,1) instead of Y(1:i,1) Also preallocate |c|: c = zeros(size(Y,1),3); You can simply write: i...

14 years ago | 1

| accepted

Answered
How to print result of dec2bin to file
fprintf(fid, [repmat('%c',1,size(B,2)) '\r\n'], B.');

14 years ago | 1

| accepted

Answered
How to get MS SQL table names via DB tbx
If you want a user-friendly approach you can use the |<http://www.mathworks.co.uk/help/toolbox/database/ug/f7-27388.html querybu...

14 years ago | 0

Answered
Problem with refreshdata in GUI
Sustitute inside the loop with: set(s1,'Ydata',[h1(j) h1(j)]) set(s2,'Ydata',[h2(j) h2(j)]) pause(.1)

14 years ago | 0

| accepted

Answered
volatility of intraday (minute data)
You can use relized measure with high frequency intraday data: http://realized.oxford-man.ox.ac.uk/data/documentation/econometri...

14 years ago | 0

| accepted

Answered
Reading a very large text file of an almost regular data with empty value
The txt I created is (with a newline character at the end, otherwise won't read properly): 4.417E-03 1.000E+00 2.200E+05 4...

14 years ago | 2

Answered
non-looping way to compare cellstr arrays of different sizes
A = {'aa', 'kk', 'ccc'}; B = {'aa', 'bb', 'cc', 'dd', 'ee'}; ismember(A,B)

14 years ago | 1

| accepted

Answered
Replace a specific portion of a string
cs = {'SPY US 09/17/11 P118 Equity' 'XOM US 08/20/11 P72.5 Equity' 'AAPL US 12/17/11 P375 Equity'}; ...

14 years ago | 1

| accepted

Answered
How to skip certain return points using the "find" command
% example data y = sin(0.1:0.1:100)*5; % Select data over threshold sel = y(abs(y) > 2); % Skip every 5 (int...

14 years ago | 0

| accepted

Answered
writing date on an excel sheet
xlswrite('test.xls', {datestr(now)})

14 years ago | 1

| accepted

Answered
searching cell array of strings
|<http://www.mathworks.com/help/techdoc/ref/strcmp.html strcmp>(string,cellstr)|

14 years ago | 0

Answered
nan as output of partial correlation analysis
X = rand(100,2); X(10) = NaN; partialcorr(X) You have NaNs in your data. partialcorr(X,'rows','pairwise') _"A 'pairwi...

14 years ago | 0

Answered
Merge confusion matrices in nice, vectorized way.
m1 = {'' 'A' 'B' 'C' 'A' 100 10 15 'B' 20 150 25 'C' 10 10 200}; m2 = {''...

14 years ago | 0

| accepted

Answered
Counting the non nan observations in a matrix by row
sum(~isnan(A),2)

14 years ago | 2

| accepted

Answered
Close GUI menu after discrete time period or user keystroke
*EDITED* % Create timer object that stops after 2.5 seconds f = 'h = findobj(0,''Name'',''GETKEY''); if h; uiresume(h); end'...

14 years ago | 0

Answered
Itraday returns/ time series creation
Before any suggestion: * Observations with the same time-stamps are usually aggregated using the median. * Which price do you w...

14 years ago | 0

| accepted

Answered
Expanding Sample Covariance Matrix
% Example inputs A = rand(100,2); B = randn(20,2); C = [A;B]; % Sample covariances (normalized by N-1) c1...

14 years ago | 0

Answered
Why am I getting these incorrect values for the dct2 function?
You have to you have to square the differences not the mean: mean2((A - B(:,:,i)).^2) or the means of symmetric distribution...

14 years ago | 0

| accepted

Answered
Nested For loop problem
You don't need the clear: clear Sum_err; Sum_err = 0; Reinitialize Tp and Peak as well: for k = 1:... Sum_err = 0...

14 years ago | 0

| accepted

Answered
How to create an irregular Matrix
% lenght of the side of the square l = 17; % Number of row sub-blocks m = 5; % Number of column sub-blocks n = 4; ...

14 years ago | 0

Answered
Need help about calling m file into Matlab command window/workspace ...
In |main.m|: ... s = a * 10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% data.m ... but then you |clear| and you declare |...

14 years ago | 0

Load more