Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
index exceeds matrix dimention

Subject: index exceeds matrix dimention

From: divya sharma

Date: 21 Apr, 2010 10:13:08

Message: 1 of 2

hi
i got a problem regarding index exceeds matrix dimension.

the problem is like this
suppose i have to add two numbers x and y
x contains 1000 of numbers which contain the value of four digits after the decimal.
and i have to add y (which contains 50 values) at perticular index's in x.
but some values of y contain the values which are having five digits after the decimal point.

let x contains the number 0.0345
y contains the number 0.34561 y contain one more digit after the decimal.
but the output will give the result containing four digits after the zero.
how to get out of this problem & get five digits after the decimal.

divya

Subject: index exceeds matrix dimention

From: Sean

Date: 21 Apr, 2010 11:39:05

Message: 2 of 2

"divya sharma" <dmatlab1@gmail.com> wrote in message <hqmj3k$q9n$1@fred.mathworks.com>...
> hi
> i got a problem regarding index exceeds matrix dimension.
>
> the problem is like this
> suppose i have to add two numbers x and y
> x contains 1000 of numbers which contain the value of four digits after the decimal.
> and i have to add y (which contains 50 values) at perticular index's in x.
> but some values of y contain the values which are having five digits after the decimal point.
>
> let x contains the number 0.0345
> y contains the number 0.34561 y contain one more digit after the decimal.
> but the output will give the result containing four digits after the zero.
> how to get out of this problem & get five digits after the decimal.
>
> divya

It is keeping the 5th decimal point.
>> format long

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us