How do I do that in MATLAB

HOW DO I DO THAT IN MATLAB SERIES?

Need help with programming in MATLAB

These are MATLAB course videos from a professor at Vanderbilt University.  I have made a playlist here for the pre-requisite information you need for EML3041 Computational Methods course!

 

 

 

 

 

A short sample programming project to exhibit how to submit one

Here is a short sample of the submission expectations for a programming project in numerical methods.

The assigned sample project assignment [PDF]; the corresponding mfile [m]; the expected complete submission report [PDF]; learn how to make a single pdf file from various parts of the sample project [BLOG].

COVID19 Regression Model and Other Thoughts

March 28, 2020
I am not an epidemiologist but do regression modeling for a living. I have done regression modeling to predict student grades just after the first test, and now we will be using adaptive learning metrics to improve our identification schemes even earlier in the semester. It is not to spell boom or doom to a student but only to intervene early with personalized recommendations.
Looking at whatever data I can use and have time to scrape, four things are reasonably clear at this time to me about COVID19.
1) First, the rate of infection is exponential but it does not stay like that forever.  The logistic function of the infection rate is analogous to how the mass of a moving rocket decreases as it burns up its fuel. F=ma, but m is not a constant.
2) Second, President Trump is finally thinking about quarantining NY, NJ, CT area. A little late but it will definitely decrease the power of the exponent.
3) Third, we have to get more testing done but one which is totally random. We could have found the effect of the spring breakers coming to FL and of the college kids being sent home to parents who are having kids late in life. Please do not send your grandkids to grandpa/grandma’s retirement home. They may be the children of the corn.
4) Fourth, Florida and Louisiana need to get their head straightened out and use tougher rules to keep people inside and a method to keep outsiders out. They are the next hot zone.

How to Make a PDF file

Before COVID19 hit our lives, it was so easy for the student to submit a hard copy.  Now with soft copies being asked for, they and the instructors have to learn a bit.

So, I had this programming assignment before COVID19 closed our face-to-face classes. It involved handwritten pages, a published file, and writing out a short description of conclusions with equations in a word processor.  The student would print them all out at home or at the university, and collate them.  But now it has to be scanned and uploaded to the CANVAS learning management system.

So, if these three types of documents were to be uploaded as one pdf file, what would you do.  I am assuming that everyone has a smartphone (an iPhone or an android phone)

If you have a printer and a scanner

Print all the documents and scan the document as a pdf file

If you have a printer but no scanner

Print all the documents.  Download the CamScanner app on your iPhone or Android and follow the instructions of this YouTube video.

Follow the directions up to the time it tells you how to email the document as I do not want you to email it to me.

If you have neither a printer nor a scanner

a) Take the handwritten documents. Download the CamScanner app on your iPhone or Android and follow the instructions of this

Follow the directions up to the time it tells you how to email the document as I want you to upload it to CANVAS.

b) For typing the pages that include equations, use MS 365 Word, and develop your document.  Save it as a .docx file first, and only then save it as .pdf file.  You can save a document as a pdf file within MS 365 Word itself.

c) a MATLAB file can be published as a pdf file. See https://autarkaw.org/2020/03/25/how-to-publish-in-matlab/

d) Merge pdf documents with Acrobat Pro. If you do not have Acrobat Pro as it costs money, use https://smallpdf.com/merge-pdf . Just drag the pdf files, and it will merge them for you.

____________________

The brute force way

(not recommended though but desperate times require desperate measures)

a) Take photos of each handwritten page.  Send the images to your email and save them on your computer.   Insert images (Insert -> Pictures in Word Menu) of the handwritten work into an MS 365 Word doc. But check your file size. It can get too big for CANVAS to handle and your internet to upload.  The limit may be 100MB.

b) For typing the pages that include equations, continue with the MS Word doc.

c) a MATLAB file can be published as a doc file. See https://autarkaw.org/2020/03/25/how-to-publish-in-matlab/  Cut and paste it into the word doc.

d) Save it as a .docx file first, and only then save it as .pdf file.  You can save a document as a pdf file within MS 365 Word itself.

______

This post is brought to you by

How to PUBLISH in MATLAB

This is how you can get your mfile published.

Click anywhere in the mfile (if your cursor is not in the mfile, you may not have the proper menu open) -> Go to PUBLISH -> Click on Down Black Arrow under Publish -> Choose Edit Publishing Option -> Choose pdf or html under Output file format

____________________

This post is brought to you by

Ability to break long fprintf statements

Problem:
A student sent me an email – ” I can’t figure out how to continue my text on another line in the editor while using the fprintf command in MATLAB.  It seems like this should be something simple, but I can’t figure it out.  The closest thing I have tried is:
fprintf(‘filler filler filler’, …
‘filler filler’)

When I run this script, this only displays the content within the first set of quotes though.

Solution:
Assign the long strings to variables, and then use the fprintf statements

abc=’My name is’
def=’ Slim Shady, also known as Marshall Mathers’
fprintf([abc def])

or you could do the following, especially if you have other non-string variables to print

abc=’My name is’
def=’ Slim Shady, also known as Marshall Mathers’
fprintf(‘%s %s’,abc,def)

_____________________

This post is brought to you by