Solved

Please check if my Matlab code is correct

Posted on 2009-04-04
5
90 Views
Last Modified: 2016-02-10
Please find attached tutorial

On page 9 no.3

I try the following code but I do not think that it is correct;

Can someone please check it for me
I = normrnd(5,1);
hist(I)

Open in new window

0
Comment
Question by:jtiernan2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 9

Expert Comment

by:masheik
ID: 24071593
include x axis values
x = 0:1:10;
I= normrnd(5,1);
hist(I,x)
0
 
LVL 1

Author Comment

by:jtiernan2008
ID: 24071693
thanks a million Lunchy

@masheik hist(I,x) brings up the same results, I changed hist(I,x) to hist(x,I)
Is this correct?
0
 
LVL 9

Accepted Solution

by:
masheik earned 500 total points
ID: 24071878
0
 
LVL 15

Expert Comment

by:yuk99
ID: 24073878
Did you actually get the correct answer? Because you problem is that you get only one number from I=normrnd(5,1);

You need to specify the size of result.
I=normrnd(5,1,100,1);
hist(I)

It's not necessary to specify x for hist, only if you need it.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Permutation and Combination 9 135
Work with App store 7 122
Just learning algebra / need solution explained 4 83
suitable program for data manipulation 7 68
How to Win a Jar of Candy Corn: A Scientific Approach! I love mathematics. If you love mathematics also, you may enjoy this tip on how to use math to win your own jar of candy corn and to impress your friends. As I said, I love math, but I gu…
When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question