Answered
Reverse the X and Y axis values in a 3D plot
% An example: [X,Y,Z] = peaks(30); surfc(X,Y,Z) colormap hsv axis([-3 3 -3 3 -10 5]) % Reverse x and y axis ...

14 years ago | 4

| accepted

Answered
Generating correlated random variables
Answer to similar question: http://www.mathworks.com/matlabcentral/answers/23173#answer_30456 *EDIT* Thread with links on...

14 years ago | 0

Answered
xlsread converting TRUE to 1
What I found so far: * typing in excel |true| converts the value to 1 (boolean true) if any numeric or general format is sele...

14 years ago | 1

| accepted

Answered
2d line plot overlay boxplot
You are actually asking two nested questions. |Hold on| applies: data = rand(100,3); boxplot(data) hold on line...

14 years ago | 1

Answered
Searching for group of letters in a structure or character string
Suppose your structure is: S(1).field = 'eth:ip:udp:dns'; S(2).field = 'eth:ip:tcp'; S(3).field = 'eth:ip'; id...

14 years ago | 3

| accepted

Answered
Easily Variable Name Changing in Editor
<http://www.mathworks.co.uk/help/techdoc/matlab_env/brqxeeu-84.html Find and Replace Text in Files> From 2011b you can use th...

14 years ago | 3

| accepted

Answered
Calculating diagonal elements of a matrix product without a loop or redundant calculations
% Example inputs F = rand(10); B = rand(10); out1 = sum(F*B.*F,2); % Elementwise out2 = diag(F*B*F'); i...

14 years ago | 2

| accepted

Answered
display an input sentence to the user on multiple lines
Use |\n| inside you string to have a newline Example: input(['Please enter the coefficients for the polynomial of the fo...

14 years ago | 8

| accepted

Answered
Box Plot with Percentiles Known
One approach is to draw the boxplot and then adjust it: Say you have data data = rand(100,2); % Your 5 (1st row),...

14 years ago | 3

| accepted

Answered
Structure array or Dataset
Try this example and tell me if it is viable. Suppose you have n files with these features: n = 100; directory = arra...

14 years ago | 0

| accepted

Answered
Create a vector with block elements of the same value
Another approach, run-length decoding: nk = n*k; out = zeros(1,nk); out(1:k:nk) = 1; out = cumsum(out);

14 years ago | 0

Answered
Collect outputs from varargout
I think you miss the point of varargout: This does exctly the same, avoiding obscure eval construction: function varar...

14 years ago | 0

Answered
uitable
An alternative: <http://www.mathworks.co.uk/support/solutions/en/data/1-D782JW/index.html?product=ML&solution=1-D782JW How do...

14 years ago | 0

| accepted

Answered
HELP PLEASE: Using a loop to read all files in a folder using xlsread
Check the faq 4.12: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F

14 years ago | 0

| accepted

Answered
Issue with multiple loops
You're changing the |i| (used by the for loop) within the while loop. You can do it but it is usually not recommended. I don...

14 years ago | 0

Answered
function name
Usually that error comes when the function has been saved on path that MATLAB cannot reach. Matlab checks for functions in t...

14 years ago | 0

| accepted

Submitted


Forecasting the FTSE 100 with high-frequency data: A comparison of realized measures
My dissertation for the MSc in Finance & Economics from Warwick Business School

14 years ago | 1 download |

5.0 / 5

Answered
Vectorize a simple matrix update operation?
Symmetry: sorry I misread your symmetry vector! It was fine. The compact version: T2(2:49,4:-1:1) = T2(2:49,5:8); My ...

14 years ago | 1

| accepted

Answered
calling specific sheet of excel after importdata
Yes, use <http://www.mathworks.co.uk/help/techdoc/ref/xlsread.html |xlsread|> within a for loop specifying the sheet to import. ...

14 years ago | 0

Answered
Meijer G function
If you have the Symbolic Math Toolbox use <http://www.mathworks.co.uk/help/toolbox/mupad/stdlib/meijerG.html |meijerG|> An ex...

14 years ago | 0

Answered
About figure that remove the Toolbar
figure('toolbar','none') or if you already have the figure set(gcf,'toolbar','none')

14 years ago | 0

| accepted

Question


Why the MATLAB Answers search bar is so bad?
*Whenever I try to search for something I get way too many results* (also unrelated). I have an example: * Searching on A...

14 years ago | 1 answer | 4

1

answer

Answered
Cell array to 1x1 Vector/Cell
This is one way: c2 = deblank(sprintf('%s ',c{:}));

14 years ago | 1

Answered
clearing specific data in matrix
Use logical indexing : idx = A <= -5; A(idx) = NaN; where A is your matrix and NaN stands for Not a Number. I advi...

14 years ago | 0

| accepted

Answered
pre-allocating structures
One way to preallocate: P(1:2) = struct('x',zeros(10,1),'y',zeros(1,2),'hole',false); ne = 10; [S(1:ne).P] = deal(P);...

14 years ago | 2

| accepted

Answered
sum within the elements of a vector
v = 1:10; out = bsxfun(@plus,v,v'); *EDIT* make diagonal elements = 0 [r,c] = size(out); out(1:r+1:r*c) = 0;

14 years ago | 0

| accepted

Answered
Please help if you can
It's not complicated to explain but it's quite annoying to implement. Have you tried my example in a comment to Sean's asnwer |f...

14 years ago | 0

| accepted

Answered
Creating dummy variable with a nested for loop
For the first company only ismember(date1,exd(1,:)) Preallocate and use a loop per company.

14 years ago | 0

Answered
Connect Matlab to an Interbase databaes
The Embarcadero developper's guide gives you directions on chapter 4 on how to establish a JDBC connection: * Install InterCl...

14 years ago | 0

Answered
if statement after use input
I don't understand probably, but: Variable = input('type 1,2, or 3 :') if Variable == 1 ... elseif Variable ==...

14 years ago | 0

Load more