f

#### help! help!! help!!! me

```hello
if
x=linspace(1,100,n);
p=linspace(100,80,n-1);
how can I get A

A=[
x(1) 1 0 0 0 0 0 0...0 0;
x(2) 1 -x(2) -1 0 0 0 0...0 0;
p(1) 0 -p(2) 0 0 0 0 0...0 0;
0 0 x(3) 1 -x(3) -1 0 0...0 0;
0 0 p(2) 0 -p(3) 0 0 0...0 0;
0 0 0 0 x(4) 1 -x(4) -1...0 0;
0 0 0 0 p(3) 0 -p(4) 0...0 0;
.......................................
0 0 0 0 0 0...x(i) 1 -x(i) -1...0 0;
0 0 0 0 0 0...p(i-1) 0 -p(i-1) 0 ...0 0;
.........................................
0 0 0 0 0 0....x(n-1) 1 -x(n-1) -1;
0 0 0 0 0 0....p(n-2) 0 -p(n-1) 0;
0 0 0 0 0 0.... 0 0 p(n-1) 0;
]
```
 0
12/27/2007 2:33:43 AM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader.

3 Replies
2315 Views

Similar Articles

[PageSpeed] 35

```"Jim lei" <redlightlike@mathworks.com> wrote in message
<fkv2u7\$t1i\$1@fred.mathworks.com>...
> hello
> if
> x=linspace(1,100,n);
> p=linspace(100,80,n-1);
> how can I get A
>
> A=[
> x(1) 1 0 0 0 0 0 0...0 0;
> x(2) 1 -x(2) -1 0 0 0 0...0 0;
> p(1) 0 -p(2) 0 0 0 0 0...0 0;
> 0 0 x(3) 1 -x(3) -1 0 0...0 0;
> 0 0 p(2) 0 -p(3) 0 0 0...0 0;
> 0 0 0 0 x(4) 1 -x(4) -1...0 0;
> 0 0 0 0 p(3) 0 -p(4) 0...0 0;
> ......................................
> 0 0 0 0 0 0...x(i) 1 -x(i) -1...0 0;
> 0 0 0 0 0 0...p(i-1) 0 -p(i) 0 ...0 0;
> ........................................
> 0 0 0 0 0 0....x(n-1) 1 -x(n-1) -1;
> 0 0 0 0 0 0....p(n-2) 0 -p(n-1) 0;
> 0 0 0 0 0 0.... 0 0 p(n-1) 0;
> ]

```
 0
12/27/2007 2:41:13 AM
```"Jim lei" <redlightlike@mathworks.com> wrote in message
<fkv3c9\$61e\$1@fred.mathworks.com>...
> "Jim lei" <redlightlike@mathworks.com> wrote in message
> <fkv2u7\$t1i\$1@fred.mathworks.com>...
> > hello
> > if
> > x=linspace(1,100,n);
> > p=linspace(100,80,n-1);
> > how can I get A
> >
> > A=[
> > x(1) 1 0 0 0 0 0 0...0 0;
> > x(2) 1 -x(2) -1 0 0 0 0...0 0;
> > p(1) 0 -p(2) 0 0 0 0 0...0 0;
> > 0 0 x(3) 1 -x(3) -1 0 0...0 0;
> > 0 0 p(2) 0 -p(3) 0 0 0...0 0;
> > 0 0 0 0 x(4) 1 -x(4) -1...0 0;
> > 0 0 0 0 p(3) 0 -p(4) 0...0 0;
> > ......................................
> > 0 0 0 0 0 0...x(i) 1 -x(i) -1...0 0;
> > 0 0 0 0 0 0...p(i-1) 0 -p(i) 0 ...0 0;
> > ........................................
> > 0 0 0 0 0 0....x(n-1) 1 -x(n-1) -1;
> > 0 0 0 0 0 0....p(n-2) 0 -p(n-1) 0;
> > 0 0 0 0 0 0.... 0 0 p(n-1) 0;
> > ]
>
Divide your matrix into sub-matrices, and then combine them.

%%
Ax1 = zeros(n-2,n-1);
Ax2 = zeros(n-2,n-1);
diagpos = sub2ind([n-2 n-1],1:n-2,1:n-2);

Ax1(diagpos) = x(2:end-1);
Ax1(diagpos+n-2) = -x(2:end-1);

Ax2(diagpos) = 1;
Ax2(diagpos+n-2) = -1;

% Ax = reshape(cat(1,Ax1,Ax2),[size(Ax1,1)
size(Ax1,2)+size(Ax2,2)])
Ax = zeros(n-2,2*n-2);
Ax(:,1:2:end) = Ax1;
Ax(:,2:2:end) = Ax2;

%%
Ap1 = zeros(n-2,n-1);
Ap1(diagpos) = p(1:n-2);
Ap1(diagpos+n-2) = -p(2:n-1);

Ap = zeros(n-2,2*n-2);
Ap(:,1:2:end-1) = Ap1;
%%
A = zeros(2*n-2,2*n-2);

A(2:2:end-2,:) = Ax;
A(3:2:end,:) = Ap;
A(1,[1 2])  = [x(1) 1];
A(end,end-1) = p(end);

Anh Huy Phan
RIKEN - BSI
```
 0
phananhhuy (130)
12/27/2007 6:07:21 AM
```In article <fkv2u7\$t1i\$1@fred.mathworks.com>,
Jim lei <redlightlike@mathworks.com> wrote:

>if
>x=linspace(1,100,n);
>p=linspace(100,80,n-1);
>how can I get A

>A=[
>x(1) 1 0 0 0 0 0 0...0 0;
>x(2) 1 -x(2) -1 0 0 0 0...0 0;
>p(1) 0 -p(2) 0 0 0 0 0...0 0;
>0 0 x(3) 1 -x(3) -1 0 0...0 0;
>0 0 p(2) 0 -p(3) 0 0 0...0 0;
>0 0 0 0 x(4) 1 -x(4) -1...0 0;
>0 0 0 0 p(3) 0 -p(4) 0...0 0;
>......................................
>0 0 0 0 0 0...x(i) 1 -x(i) -1...0 0;
>0 0 0 0 0 0...p(i-1) 0 -p(i-1) 0 ...0 0;
>........................................
>0 0 0 0 0 0....x(n-1) 1 -x(n-1) -1;
>0 0 0 0 0 0....p(n-2) 0 -p(n-1) 0;
>0 0 0 0 0 0.... 0 0 p(n-1) 0;
>]

See the functions diag() and blkdiag().

Also, please use a more descriptive topic name.

Another note: when you post requesting urgent help without describing
your timeframe, then after a couple of hours, people are likely not
sometimes, perhaps even within the first few hours, they may choose
not to respond, with thoughts about it being irresponsible of you
to have left the task to the last minute. There is a saying,
--
What will be your last contribution?
-- Supertramp (Fool's Overture)
```
 0
roberson2 (8602)
12/27/2007 8:38:26 PM

Similar Artilces:

Help Help Help Help Help
please,help us . we have a seious problem, we are designing a radio controlled car that is guided by the PC, to send the data wireless between the PC and the Car and vice versa. we use 2 transmitter/reciever circuits from 2 seperate radio controlled car each running with a different frequency (27 MHz & 40 MHz)and modify the functionality of each to do the disered work. but on mounting a transmitter(40MHz) and reciever(27MHz) on the car, and attach another transmitter(27MHz) and reciever(40MHz) to the PC; we found that on sending signals from the car to the PC on the transmitter & rec...

help!help!help!help!
I am a student.I am going to make a simulation of a robot (FANUC Robot M-16iB) under the matlab\simulink environment . It is a normal 6DOF robot.I want to realize any angle and any speed (under the max speed) and any position and orientation control. As I just starting to do this new field,I have no experience about it. Can you give me some simulation demo or examples for 6DOF robot? I am very eager to get these.Please write back to me as soon as possible,thank you! Sincerely, Connie&#12288;&#12288;&#12288;&#12288;&#12288;&#12288;&#12288; zhanglijuan920@sohu.c...

Help Help Help

HELP HELP HELP
Hi! All, I am an Interactive Media Designer and know very less about asp but the basic concept behind. I got to make an online test(Exam) in asp which has a login (frm access database) panel. Can any one direct me to a free source so that I can simply pick the project and customize it. Thnaks in Advance Raj.Design In article <1112007306.454441.207430@f14g2000cwb.googlegroups.com>, raj.design@gmail.com enlightened us with... > Hi! All, > I am an Interactive Media Designer and know very less about asp but the > basic concept behind. I got to make an online te...

HELP-HELP-HELP!!!!!!!!!!
On this site par example: http://communications.siemens.com/cds/frontdoor/0,2241,nl_nl_0_27443_rArNrNrNrN,00.html u have a 3d animation, like many other sites...but if i want to see this a new window opens and i see a icon with ared cross in it. also on sites with games i see this... What is my problem? I have winXP-Pro firewall is out and sec. is on low..... twan1@home.nl (Twan) writes: > On this site par example: > http://communications.siemens.com/cds/frontdoor/0,2241,nl_nl_0_27443_rArNrNrNrN,00.html > u have a 3d animation, like many other sites...but if i want to...

Help Help Help

help help help
I need to refresh my C knowledge quickly. I will be reading code for simple industrial type controls like motor controllers, valve drivers, etc This software is pretty simple, 3000 lines max. The executable is embedded in flash on the processor chip. Actually I haven't seen it yet. I haven't looked at C or done any programming in ages. I'm looking for a simple programming suite that will run on my WinXP (NTFS) computer. Something that doesn't take really long to get up to speed with. Simple is better. I just need to practice and remember and do some simple experi...

Help!! Help!! Help!!
I wish to vectorize the following code: s = tf('s'); W = logspace(-1,2,50); COMBINATION = combn(W, 2); K = cell(length(COMBINATION), 1); K0 = 1 + (1/(2*s)) + 0.5*s/(0.2*s + 1); % PID controller to be approximated as PI gapValue = zeros(length(COMBINATION), 1); for i = 1:length(COMBINATION) K{i} = (COMBINATION(i,1)*(1 + (1/(COMBINATION(i,2)*s)))); % PI controller end for i = 1:length(COMBINATION) gapValue(i,1) = gapmetric(K0, K{i}); end where K0 is the Nominal transfer function and K is a cell array including transfer functions whose gap metric from K0 are...

Help Help Help
Q1 I want to know how to show the 8 bit planes of the image?? Q2 And also find edges of image by showing both edge magnitude and direction?? ...

help! help!! help!!!
x=[0 1 10] p=[100 80] how can I get A A=[3x(1) 2x(1) x(1) 1 0 0 0 0; 2x(1) x(1) 1 0 0 0 0 0; 3x(2) 2x(2) x(2) 1 -3x(2) -2x(2) -x(2) -1; 2x(2) x(2) 1 0 -2x(2) -x(2) -1 0; p(1)x(1) p(1) 0 0 -p(2)x(2) -p(2) 0 0; p(1) 0 0 0 -p(2) 0 0 0; 0 0 0 0 -p(2)x(3) -p(2) 0 0; 0 0 0 0 -p(3) 0 0 0; ] In article <fkus3t\$11h\$1@fred.mathworks.com>, Jim lei <redlightlike@mathworks.com> wrote: >x=[0 1 10] >p=[100 80] >how can I get ...

HELP! HELP! HELP
I hope someone out there can solve my mysterious problem. I have tried everything imaginable, even paid \$35 to Microsoft to help me, but they were not able to figure out this problem: Here is the problem: I recently created a new database in Access 2002. I took data from an > access 97 database converted one of the tables to access 2002 and then > imported it into a new table in access 2002. but for some strange > reason, every once in a while the data changes to Japanese characters, > it only happens once in a while, but once it happens that record is > lost. i have tried...

help help help
Sir, Am Avinash.T.J doing my btech AMRITA ...

Help, Help, Help...
Hei! Im makin a hot INVADERS game with Java but im a newbie with language, so , question is how do i use KeyPressed () function... I hav Applet Runnable... -!Hei!- Here is my problem... public class TestinKeys extends Applet implements Runnable .... .... public void run () { while ( true ) { KeyEvent ke; if ( ke.getKeyChar() == 'a' ) g_TykkiX ++; .... .... What is Wrong, im tryin to make that Invaders game but i dont know how to read keyboard with Runnable Java code... JariTapio <JariTapio@pp.inet.fi> wrote: > publi...

HELP HELP HELP...
Hi everybody there. I have created a GUI in MATLAB's guide application. In the GUI I am appearing on the screen a frame from a camera by pushing a button. My problem that sometimes the application works fine, but some others something is going wrong and I get the following error message: ??? Assignment has more non-singleton rhs dimensions than non-singleton subscripts Error in ==> LEDsFinal>txtGrabFrame_Callback at 164 A(width, i, Blue) = abs(fread(portCMU, 1, 'uint8'))/255; What does the error message mean? What seems to be the problem? How can I overco...

Web resources about - help! help!! help!!! me - comp.soft-sys.matlab

Help - Wikipedia, the free encyclopedia
United States Senate Committee on Health, Education, Labor and Pensions , commonly abbreviated "H.E.L.P." Text is available under the Creative ...

Help:Contents - Wikipedia, the free encyclopedia
Templates are special pages that contain boilerplate text intended to be displayed on more than one page in Wikipedia. This Tip of the day box ...

Mass. cop helps homeless woman get food, shelter before storm
Seekonk police officer came to the aid of a woman in distress, and a Facebook post about the incident has gone viral

Confusion helps gold to shine
Concerns over the global economy have added an extra shine to safe-haven assets such as gold, according to the chief executive of a top mining ...

Hasbro Raises Dividend With Help From Strong ‘Star Wars’ Toy Sales In Q4
The Force is paying off for Hasbro investors. The toy maker just raised its dividend by 11% as it reported better-than-expected Q4 earnings, ...

Bananas May Help Detect, Cure Skin Cancer
An enzyme found in overripe bananas is also prevalent in people with melanoma.