TutorMe homepage
Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
Harry R.
MCAT, Medical School Mentoring
Tutor Satisfaction Guarantee
R Programming
TutorMe
Question:

What is he code which would create a matrix of 35X40 filled with random integers, then perform a batch multiplication of every value, then a for loop (for practice) which divides each index by what you previously multiplied it by, and finally transform the final output matrix and check dimensions are reversed.

Harry R.
Answer:

# Multi is the multiplier I used multi <- 100 # Created random dataset in a matrix with 1400 vaules in a random distributions m.old <- matrix(data = rnorm(1400), nrow = 35, ncol = 40) # Multiplied old m.multi <- m.old*multi # Assign new matrix with appropriate rows and columns for regenerated values m.new <- matrix(nrow = 35, ncol = 40) # This for loop iterates through all the indexes for the rows dim(m)[1] and columns dim(m)[2] for (i in 1:dim(m)[1]){ for (z in 1:dim(m)[2]){ # Divides each individual index value by the multiplier and assigns it to same coordinate in new matrix m.new[i,z] <- m.multi[i,z]/multi } } # Transforms matrix (rotates values in rows and columns to create a 40X35 matrix) mt.new <- t(m.new) # This command should output 40X35 dim(m.new) # for some fun to see what everything looks like, try 'matrix[rowRng,colRng]', ex. m.old[1:5,1:5]

Biochemistry
TutorMe
Question:

How do oceanic mammals stay underwater so long?

Harry R.
Answer:

The difference is in their ratio of hemoglobin/myoglobin. As humans we have a lot more hemoglobin which comes in a 4 protein complex which can adjust the affinity for oxygen based on it's surrounding environment (Hydrogen ions, bicarbonate etc). Myoglobin lacts these adjustment mechanisms, so that it releases oxygen to tissues at one steady slow rate, which makes it ideal for storing vast amounts of oxygen in tissues for slow release on long deep sea dives.

Computer Science (General)
TutorMe
Question:

What are purposes of control statements in coding and why are they so useful?

Harry R.
Answer:

Control statements, if, or, and ect. allow us to control when the application meets a critical error due to input (checking inputs with if statements), and they are also extremely helpful in funneling your processes into the correct bins for further processing.

Send a message explaining your
needs and Harry will reply soon.
Contact Harry
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.