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

New to MATLAB?

Thread Subject:
Building a matrix in this form

Subject: Building a matrix in this form

From: Alan`

Date: 12 Jun, 2011 22:50:19

Message: 1 of 3

I have a homework assignment and i'm trying to figure out some functions that could help me write the matrix in this form (on that site) like if i wanted to make a matrix with 1000 ones and not have to write 1 a hundred times.. any help will be appreciated, thank you.

Subject: Building a matrix in this form

From: Image Analyst

Date: 12 Jun, 2011 23:13:04

Message: 2 of 3

To set an entire row to a value:
M(rowNumberToSet, :) = theValue;
M(42, :) = 2.718281828;

To set an entire column so a value:
M(:, columnNumberToSet) = theValue;
M(:, 69) = 3.14159;

This is basic MATLAB stuff - the stuff you learn the first couple of hours into it. You should find it early on in the "Getting Started" section of the help.

Subject: Building a matrix in this form

From: Roger Stafford

Date: 13 Jun, 2011 02:19:07

Message: 3 of 3

"Alan`" wrote in message <it3frb$o4d$>...
- - - - - - - -
  It is possible to solve that problem entirely in your head by just staring at the given matrix long enough and hard enough while remembering all the things you have been taught about determinants, and without ever touching a computer keyboard. My opinion is that if you do the matlab stuff first you could be less likely to discover the "mathematical proof" part of the assignment. Anyway good luck to you.

Roger Stafford

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