MATLAB help!

Kinja'd!!! by "TheHondaBro" (wwaveform)
Published 01/17/2017 at 22:17

No Tags
STARS: 0


Long story short, my “programming prep” course threw me into MATLAB so hard I hit the ground and bounced.

Anyway, I need to create a 1200 x 1200 matrix of zeros with the value 75 on the minor diagonal.

Help!


Replies (25)

Kinja'd!!! "TrustMeImAnEngineer, but I'd rather be an InternationalArtThief" (trusttheengineer)
01/17/2017 at 22:24, STARS: 0

How clean does the code need to be?

Kinja'd!!! "bob and john" (bobandjohn)
01/17/2017 at 22:24, STARS: 3

“MATLAB”

Kinja'd!!!

Kinja'd!!!

Kinja'd!!!

Kinja'd!!!

Kinja'd!!!

Kinja'd!!!

Kinja'd!!!

Kinja'd!!!

Kinja'd!!! "sm70- why not Duesenberg?" (sm70-whynotduesenberg)
01/17/2017 at 22:24, STARS: 2

Did you try turning it off and then turning it back on again?

Kinja'd!!! "TheHondaBro" (wwaveform)
01/17/2017 at 22:26, STARS: 0

I really don’t care. As long as it can help me understand arbitrary matrices better.

Kinja'd!!! "TrustMeImAnEngineer, but I'd rather be an InternationalArtThief" (trusttheengineer)
01/17/2017 at 22:32, STARS: 3

A = flip(75*eye(1200)); *Edited because I had my test dimension of 5 in here at first

As clean as I can get it in one line.

“eye” creates the identity matrix of ones on the diagonal and zeros everywhere else. multiplying by 75 is self explanatory, and flip flips the rows vertically (1st row becomes last, last is first, etc..)

Kinja'd!!! "Dr. Zoidberg - RIP Oppo" (thetomselleck)
01/17/2017 at 22:32, STARS: 0

You shouldn’t be handling minors anyway.

Kinja'd!!! "TheHondaBro" (wwaveform)
01/17/2017 at 22:36, STARS: 1

You are my own personal Jesus Christ.

Kinja'd!!! "TheHondaBro" (wwaveform)
01/17/2017 at 22:36, STARS: 1

Better them being sober than your drunken minors. You sicken me, crustacean.

Kinja'd!!! "TrustMeImAnEngineer, but I'd rather be an InternationalArtThief" (trusttheengineer)
01/17/2017 at 22:41, STARS: 1

I just have to live up to my username. Now to steal something from the Louvre...

Kinja'd!!! "unclevanos (Ovaltine Jenkins)" (unclevanos)
01/17/2017 at 22:46, STARS: 1

MATLAB is a poo.

I can’t help you there my coding is pure shit.

Kinja'd!!! "FTTOHG Has Moved to https://opposite-lock.com" (alphaass)
01/17/2017 at 22:49, STARS: 0

This is as clean as it gets. I spend probably 33% of my life in MATLAB and can’t think of a better way.

Kinja'd!!! "scoob" (scoobsti)
01/17/2017 at 23:16, STARS: 1

Kinja'd!!!

Kinja'd!!! "Dr. Zoidberg - RIP Oppo" (thetomselleck)
01/17/2017 at 23:21, STARS: 0

Hey I provide safe haven for those drunk children. What charitable act have YOU done lately? Other than save my life that one time.

Kinja'd!!! "TheHondaBro" (wwaveform)
01/17/2017 at 23:21, STARS: 0

I told inner-city rapscallions to stay in school and don’t do drugs.

Kinja'd!!! "Dr. Zoidberg - RIP Oppo" (thetomselleck)
01/17/2017 at 23:22, STARS: 0

Did you tell them to stay in PUBLIC schools, though? They’re all doomed.

Kinja'd!!! "TheHondaBro" (wwaveform)
01/17/2017 at 23:35, STARS: 0

I told them to stay out of God’s Kingdom.

Kinja'd!!! "Dr. Zoidberg - RIP Oppo" (thetomselleck)
01/17/2017 at 23:38, STARS: 0

Burger King?

Kinja'd!!! "TheHondaBro" (wwaveform)
01/17/2017 at 23:42, STARS: 0

*is making reference to da concourse post*

Kinja'd!!! "Dr. Zoidberg - RIP Oppo" (thetomselleck)
01/17/2017 at 23:45, STARS: 1

hashtag not my god dot png

Kinja'd!!! "tromoly" (tromoly)
01/17/2017 at 23:46, STARS: 0

How convenient, someone else currently working in MatLab. High five?

Kinja'd!!! "TheHondaBro" (wwaveform)
01/17/2017 at 23:47, STARS: 0

Too angery to high five.

Kinja'd!!! "Shoop" (shoopdawoop993)
01/17/2017 at 23:52, STARS: 0

I learned this then promptly forgot it

Kinja'd!!! "NYankee1927" (nyankee1927)
01/18/2017 at 09:28, STARS: 0

If this is being graded, the instructor is going to know this isn’t his own work. In the beginning it’s for loops or nothing for making matrices!

Kinja'd!!! "jimz" (jimz)
01/18/2017 at 11:36, STARS: 1

ah, MATLAB. I have a small program written in it which will generate biquad coefficients in both S- and Z-domain. It’s a nice, small, 6 MB application.

Which needs the 800 MB MATLAB compiler runtime in order to be usable. The only one worse than Mathworks is National Instruments.

Kinja'd!!! "e_is_real_i_isnt" (e_is_real_i_isnt)
01/20/2017 at 19:58, STARS: 0

Want fun? Try R.