MATLAB TUTORIAL - PART IV

Since we will be dealing with matrices a lot, it is always good to learn some matrix and vector operations. And one of the mostly used operations is the transpose operation, where if applied to a vector, it will switch row(column) to column(row), and when it is applied to a matrix, it will switch rows(columns) to columns(rows). And it is applied when typing ‘ to the variable as shown in the example below:

>> a3
a3 =
1     3     5
1     3     4
23    41    59

>> a3′
ans =
1     1    23
3     3    41
5     4    59

And since the basic elemet of MATLAB is the array, it is good to master the addressing of its elements. You can address individual elements or subgroups in a matrix or vector.

In the case of vectors, all you have to do is to execute vector(k) where k is the position of the element that we want. While in the case of matrices, we have to specify the number of row and the number of column of the element wthat we want. so Matrix(k,p) will give you the element at the intersection between row k and column p. Of course you can change the value at that location by executing:

Vector(k)=newvalue

Matrix(k,p)=new value

Here is an example to address an element in a vector:

v =
2     3     5     6    77     7
>> v(3) Read more…

MATLAB TUTORIAL - PART III

As we have mentioned earlier, Arrays are fundamental forms used to in MATLAB to store and manipulate data.
It is a list of numbers arranged in rows and/or columns. And of course, the simplest array, is a one dimensional array which is know as a Vector.
And a vector can be of 2 forms, either a row vector or a column vector.
We should note that Arrays can handle numbers as well as charaters and strings.

A one dimensional array, can be used for example to represent the position of a point in space.
Of course, there are several ways to create a vector depending on the source of information which can be specific numbers or mathematical expressions or a series of elements with constant spacing.

Below are some of the different forms:

  • If you have a certain number of data like the profit of a company between in years 1988 1989 1990 1991

You can directly represent the info above by:

>> year=[1988 1989 1990 1991]
year =
1988        1989        1990        1991
>> profit=[10000;15000;8000;1000]
profit =
10000
15000
8000
1000

  • Vectors with constant spacing

Vector_name=a:n:b

where a is the first term, n is the spacing , and b is the last term.

If we remove n, the default spacing will be equal to 1. Below is a example on how to use this vector spacing:

>> x=2:2:10
x =
2     4     6     8    10 Read more…

MATLAB TUTORIAL - PART II

The default display format is the ’short’ where we have 4 decimal digits after the fixed point. We can always change the format by typing the format command, and for more info about parameters to use, type ‘help format’ in the command window.

Below you can find the commands that can be used, with their description and an example on each case:

  1. format short: fixed point with 4 decimal digits >> 280/6ans =46.6667
  2. format long: fixed point with 14 decimal digits>> 280/6ans =46.666666666666664
  3. format short e: scientific notation with 4 decimal digits>> 280/6ans =4.6667e+001
  4. format long e: scientific notation with 15 decimal digits>> 280/6ans =4.666666666666666e+001
  5. format short g: best of 5-digit fixed or floating point>> 280/6ans =46.667
  6. format long g: best of 15-digit fixed or floating point>> 280/6ans =46.6666666666667
  7. format bank: two decimal digits>> 280/6ans =46.67
  8. format compact: eliminates empty lines to allow more lines with info to be displayed on the screen Read more…

MATLAB TUTORIAL - PART I

MATLAB is a powerful language for technical computing.

MATLAB means MATrix LABoratory, since the basic element in MATLAB is a matrix.

It is a very helpful mathematical tool used in all engineering computations, modelling and simulation, data analysis and processing, visualization and graphics, as well as algorithm development.

As you may know, MATLAB is huge so it is impossible to cover all MATLAB at once. So we will focus here on the foundations of MATLAB, and once understood, any topic will be easily understood. And of course, the HELP menu is a very rich source of information in case we are stuck.

In this part of the tutorial, we will describe the different windows in MATLAB, while concentrating on the Command Window. We will also deal with arithmetic operations with scalars. Of course, we will define the scalar variable first and then introduce the elementary math functions that can be applied on scalars.

The default view of MATLAB consists of 3 main windows which are :

  1. Command window
  2. Current directory window
  3. Command history window

And there is the start button in the lower left corner of the screen which is used to access MATLAB tools and features.

The purposes of the windows in addition to the 3 windows mentioned above are listed below:

  • Command window: main window, enters variables, runs programs
  • Figure window: contains output from graphic commands
  • Editor window: creates and debugs script and function files
  • Help window: provides help information
  • Launch pad window: provides access to tools, demos and documentations
  • Command history window: logs commands entered in the command window
  • Workspace Window: provides information about the variables that are used
  • Current directory window: shows the files in the current directory Read more…

POOR QUALITY SLEEP LINKED TO ELEVATED BLOOD PRESSURE IN TEENS

Can you imagine that something as simple as improper sleep can be one of the causes of elevated blood pressure?

This is a well known fact for adults, but recently a new study suggests that there is a link between inadequate, low-quality sleep and healthy teen.

Teenagers with inefficient sleep (meaning they have trouble falling asleep or wake early) and those with insufficient sleep (less or equal to 6.5 hours a day) had an increased risk of having elevated blood pressure.

Even after adjustment for other possible contributing factors, teens with poor sleeping patterns had systolic blood-pressure levels that were on average 4 mm Hg higher than other children; which is really significant.

This is just one reason to push us more into giving our sleep time more importance. There are several other reasons.

So sleep well from now on!!!!!

VITAMIN C and Cancer

Did you ever think that a disease as complicated as cancer can be treated by something as simple as a vitamin?!?!?

A recent study on mice have shown that vitamin C can have a role in the reduction of tumor size.

But how does it do so? Although vitamin  C is an antioxidant, meaning that it removes free radicals which lead to cancer, it is also a pro oxidant. And fortunately, its a pro oxidant only towards malignant cells.

A single parenteral doses of vitamin C, in the study, led to free radical formation only in tumor tissue without any signs of free radicals in the blood.

Despite its potential role in chemotherapy, vitamin C cannot be considered curative as a single agent yet. However, using it as an addition to other regimens is a good idea, especially if used against tumors with poor prognosis.

SYNCHRONIZE WINDOWS LIVE HOTMAIL WITH MICROSOFT OUTLOOK

Have you ever wondered about synchronizing your Hotmail inbox without Microsoft Outlook and for FREE..

Now it is possible with Microsoft Office Oulook Connector where you can use Microsoft Office Outlook 2003 or Microsoft Office Outlook 2007 to access and manage your Microsoft Windows Live Hotmail or Microsoft Office Live Mail accounts, including e-mail messages and contacts.

You can download it using the link below:


Click here to Download.

All you have to do is to install it. A pop up  message will ask you about your Hotmail account username and password.

Having done all the steps above, a regular send/receive will synchronize your Live Hotmail account with your Outlook folder.

How NOT to Use Powerpoint

According to Don McMillan, here is a humorous & yet insightful viewpoint on how people (teachers included) should not be using PowerPoint.

A GOOD WIFE

I’ve got no idea where this picture came from, but I think it is really nice since it shows how

“A GOOD WIFE CAN BRING BALANCE TO A MAN’S LIFE”.

PRIMAVERA TUTORIAL - PART 1

In this part of the tutorial, we will have a look about how to create a project. We will also cover how to add your company’s logo, which is really interesting when it comes to presenting the project. Also we will start adding the activities or events that we have in order to accomplish the whole project.

Creating the Project

Creating projects in Primavera 3.0 (P3) is easy. Simply establish the objective and specify a start date.

1. Click Start, Programs, Primavera, and then select Primavera Project Planner.

2. Choose File, New, then type a unique four-character project name

3. Enter the version number, project title, and company name.

4. Specify the planning unit which determines the time unit P3 uses to schedule the project. In our case, it is days. Also we have to choose the Workdays/week, which is “6” in our case since Sundays are off. In addition, we have to specify that the Week starts on Monday. Read more…