Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Number in a matrix

Subject: Number in a matrix

From: Jess J

Date: 30 Mar, 2011 08:34:04

Message: 1 of 2

Hi,

I have created a matrix
A= crtbp(a, b^c), where a,b, c are integers.

My question now is that i want to set the first column and last column of the matrix A to be 1. Can anyone here can guide me?

Thanks alot.

Regards,
Jess

Subject: Number in a matrix

From: Wayne King

Date: 30 Mar, 2011 09:29:04

Message: 2 of 2

"Jess J" wrote in message <imupts$b5j$1@fred.mathworks.com>...
> Hi,
>
> I have created a matrix
> A= crtbp(a, b^c), where a,b, c are integers.
>
> My question now is that i want to set the first column and last column of the matrix A to be 1. Can anyone here can guide me?
>
> Thanks alot.
>
> Regards,
> Jess

Hi Jess, crtbp() is not a Mathworks' function, so I don't know what that does, or what its output is, but by your post, I'll assume it's a matrix.

You can just do

 A(:,[1 end]) = 1;

Wayne

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us