MATLAB Matlab and floating point, function for min n max?

  • Thread starter brandy
  • Start date
161
0
so i found this program matlab on the computers at uni. ive been messing around with it. right now im learning a bit about floating point systems and stuff and i thought it would be cool to write up a function that finds the smallest and largest numbers but turns out its harder than i first thought.
smallest was easy(er)
1*beta^m and I ignore the significant figures hehe, any ideas on how i fix that?

largest is hard. because i cant ignore them k's :S
will something like this work? im not actually on matlab atm so i cant test myself haha.

u = 0.5*beta^(1-k)
c=[0:k-1];
result = sum((beta-1)*beta^M / beta^c)


oi and whats with the realmin realmax stuff, could i actually use that instead?
 

Want to reply to this thread?

"Matlab and floating point, function for min n max?" You must log in or register to reply here.

Related Threads for: Matlab and floating point, function for min n max?

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top