Answered
How do a textscan to read the value in the line above the strmatch
fid = fopen('C:\Users\Oleg\Desktop\test.txt'); out = textscan(fid,'%s%f%f%f%f%f%f%f%f%f%f\r\n%f%f\r\n%f','CollectOutput',1)...

14 years ago | 0

Answered
How to name variable in each incremental loop?..
Don't do that: <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F faq 4.6> (read til...

14 years ago | 3

| accepted

Answered
Inputdlg respond to enter?
You can modify inputdlg so that the focus is automatically set on the enter button otherwise you have to push tab before enter.

14 years ago | 1

| accepted

Answered
mldivide condition number
No you cannot. Explicitly means you are using *<http://www.mathworks.com/help/techdoc/ref/cond.html cond>*? Did you try the *<...

14 years ago | 0

Answered
3 eq 3 unknowns big mess
With the optimization tb: f=@(x)[7939*cos(x(2))*sin(x(3))/100-9*cos(x(2))*cos(x(3))/20-367*sin(x(2))/50+441/200; 793...

14 years ago | 0

Answered
finding endpoints of a label
Based on the idea of http://www.mathworks.com/matlabcentral/answers/10293-finding-neighbor-of-a-position I = [0 0 0 0 0...

14 years ago | 0

| accepted

Answered
finding neighbor of a position
*EDITED: should be fine now* I =[ 1 0 0 2 5 0 0 0 3 0 0 0]; l = 8...

14 years ago | 1

| accepted

Answered
How can I cut some digits from a number?
n = 121313.334242; fix(n*10000)/10000

14 years ago | 1

| accepted

Answered
how can I convert a decimal to an integer?
* fix to strip all the decimals * round can change the integer part fix (1.9) % 1 round(1.9) % 2

14 years ago | 7

| accepted

Answered
Boxplot Data
It way easier to calculate the stats: min max quantile(x,[.25 .5 .75]) mean

14 years ago | 2

Answered
AssetPaths
You can declare a <http://www.mathworks.com/help/techdoc/ref/function.html function> only in a separate m. file and only as the ...

14 years ago | 1

Answered
How do I simplify this code (remove for loop)?
idx = acos(rel_vec * vec_array) > pi/2; rvec(:,idx) = -rvec(:,idx); where _rel_vec_ is 1 by 3.

14 years ago | 0

| accepted

Answered
Dummy variables and explanatory variables in ARMA/GARCH models
Huge limitation and not only this one: the answer is *NO* to both. Look here for an unanswered question i posted some time ag...

14 years ago | 0

Answered
constrained least square fitting
You can use <http://www.mathworks.com/help/techdoc/ref/lsqnonneg.html lsqnonneg> or if you have the Optimization TB then <http:/...

14 years ago | 0

Answered
Function to read find title of an excel column
Import the excel sheet: [data, text] = xlsread(...); Now, use: idx = strcmpi(text(1,:),'HeaderIamLookingFor') d...

14 years ago | 1

| accepted

Answered
Garch meanForecast in loop?
* You're overwtiting everytime the variables * ??for i:1:i?? DO NOT increase the looping index _i_ inside the loop * DO NOT us...

15 years ago | 0

Answered
Extracting everything from a structure
Don't do that: http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F Think if you had 2...

15 years ago | 1

Answered
Is there a smarter way to create a large vector, with repeated numbers in a diminishing quantity?
Using <http://www.mathworks.com/matlabcentral/fileexchange/6436-rude-a-pedestrian-run-length-decoder-encoder rude> for run lengt...

15 years ago | 0

Answered
insert into array with probability
% Create sample a and cf a = randi([1,100],4,1); cf = rand(4,1); cf = cf/sum(cf); % Suppose our b has 1000 elemen...

15 years ago | 0

Answered
displaying subdata points within the same figure.
http://www.mathworks.com/matlabcentral/fileexchange/26007-on-figure-magnifier and the related links

15 years ago | 1

| accepted

Answered
retrieve value from specific location of matrix
use <http://www.mathworks.com/help/techdoc/ref/sub2ind.html sub2ind> to create from coordinates an index that points to the posi...

15 years ago | 0

| accepted

Answered
solve nonlinear equation
You cannot <http://www.mathworks.com/help/toolbox/symbolic/solve.html solve> a function handle. You have to convert the anonymo...

15 years ago | 0

Answered
Plot different colors while using loops.
you can simply, and it will automatically change the colors for each series: plot(array1,array2,'o') Check out the <http...

15 years ago | 4

Answered
how add multiple lines on 2 overlapped plots and brush all
X1 = {1:10,5:14}; Y1 = {cos(1:10),rand(10,1)}; X2 = {3:6,1:8}; Y2 = {sin(3:6),rand(1,8)}; numE = numel(X1); ho...

15 years ago | 0

| accepted

Answered
Confidence Interval for an extreme value distribution
http://www.mathworks.com/help/toolbox/stats/bqt29ct.html look for extreme value or generalized extreme value distributions. *...

15 years ago | 1

| accepted

Answered
Creating an inline-function in dependence of a parameter
c = 5; f1 = inline([sprintf('%d',c) '*x^2']) f2 = str2func(['@(x)' sprintf('%d',c) '*x^2']) isequal(f1(2),f2(2)) % ok...

15 years ago | 0

Answered
Garch forecasting
You have to fit (garchfit?) the past history (X) to retrieve the coefficients and supply them to: Spec = garchset(...,'Regr...

15 years ago | 0

Answered
Stepwise regression with no Constant
It doesn't say so neither in <http://www.mathworks.com/help/toolbox/stats/stepwisefit.html stepwisefit> nor in <http://www.mathw...

15 years ago | 0

Answered
Plotting a simulated forecast?!
You can plot the price against the forecast: plot(1:100,price) hold on plot(1:100,meanForecast,'or') Or you can pl...

15 years ago | 0

| accepted

Answered
Loop problem
Then: Result = models(bsdata,:); You will draw rows direclty fro models.

15 years ago | 0

| accepted

Load more