TutorMe homepage
Subjects
PRICING
COURSES
Start Free Trial
Andrew L.
PhD Student at the University of Michigan
Tutor Satisfaction Guarantee
MATLAB
TutorMe
Question:

You have 3 computers that you use matlab on. How would you avoid having the change your script everytime to accomodate for the changing directories from computer to computer?`

Andrew L.

Once again the solution is a function (in this case called gpath). By using a combination of 1 - [~,pcname] = system('hostname') 2 - if statements The desired result can be obtained

Statistics
TutorMe
Question:

Can a bar graph with 2 means using Standard Error of the Mean visually demonstrate statistical significance?

Andrew L.

This is a trick question When SEM bars do not overlap You cannot be sure that the difference between two means is statistically significant. This is also true when you compare proportions with a chi-square test. When SEM bars do overlap In this case you can be certain the difference between the two means is not significant

Data Science
TutorMe
Question:

How would you import text files into matlab by reading all text and numbers separately from each other before handling them in further scripts?

Andrew L.

The answer is by creating a function function [ file_Array, data ] = load_data( file_name) %This funtion loads data using importdata. Then the column headers are %separated into their own cell rather than all of them being in one cell. %Import Data dataArray=importdata(file_name,'\t'); %Separate column headers into their own cell for i=1:4 %Use textscan to make separate all the text h_1_str=dataArray.textdata{i,1};%I changed this from 1 to 4 for my txt files %header=[' ', h_1{1}.']; expression = '\t'; header= regexp(h_1_str,expression,'split'); %Replace the column header cells in the array dataArray.textdata(i,:)=header; end %Put the organized column headers into an array and the data into a matrix file_Array=dataArray.textdata; data=dataArray.data; end

Send a message explaining your
needs and Andrew will reply soon.
Contact Andrew