variable of arbitrary size

4 ビュー (過去 30 日間)
Mohamad daneshbodi
Mohamad daneshbodi 2012 年 11 月 21 日
Hi I am a newbie in MATLAB. THis is my function which is similar to quadprog but in much smaller scale. "function [ x,fval ] = apple( Q,A,b,lb,up,x0)" my fval is x'*Q'x and my problem is that for any matrix Q(n*n) I need to have vector X=[X1;X2;X3....;Xn]. how can I initialize X of having corresponding size to n. x0 can also be inputted which might be helpful in creating X however x0 is not variable and has values.
I am stuck can anyone please help me with that.Thank you in advance

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 11 月 21 日
X = zeros(n, 1);

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by