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:
Is it possible to return an identity matrix of the same dimension?

Subject: Is it possible to return an identity matrix of the same dimension?

From: John

Date: 12 Feb, 2013 22:47:06

Message: 1 of 3

Is there away to use a scalar as an input and return the identity matrix of the same dimension?

Would this be the road to start on?

-------Editor Window---------
function MyEye(a)

MyEye(a) == eye(a);
b = MyEye(a)
end
-----------Command Window--------
y = MyEye(3)

Thanks

Subject: Is it possible to return an identity matrix of the same dimension?

From: dpb

Date: 13 Feb, 2013 00:05:30

Message: 2 of 3

On 2/12/2013 4:47 PM, John wrote:
> Is there away to use a scalar as an input and return the identity matrix
> of the same dimension?
...

Sure, isn't that just the one-input-argument form of eye() that already
is builtin???

What's the need for another function?

--

Subject: Is it possible to return an identity matrix of the same dimension?

From: Jos (10584)

Date: 13 Feb, 2013 09:10:06

Message: 3 of 3

"John" wrote in message <kfegpa$kna$1@newscl01ah.mathworks.com>...
> Is there away to use a scalar as an input and return the identity matrix of the same dimension?
* snip ...

This is confusing ... Same dimension as what? Note that a scalar is a singleton ...

~ Jos

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