When i try this sym('x')^y i get an error message
1 回表示 (過去 30 日間)
回答 (2 件)
Vladimir Sovkov 2020 年 12 月 11 日
You cannot compute this directly because the integers are larger than matlab is able to treat.
You can try
b = sym(log10(18008617784390347685963)*60322355516214665580)
so that the value you are interested in is
Daniel Pollard 2020 年 12 月 11 日
編集済み: Daniel Pollard 2020 年 12 月 11 日
I haven't used the symbolic toolbox before, but when I type 18008617784390347685963^60322355516214665580 into my Matlab commandline it returns Inf. Computers can't handle very big numbers, and that number will be one with over 1e21 digits. You haven't told us the error message (which you should, as a rule) but this seems most likely. Google can act as a calculator and that returns 'undefined'.
What on earth do you need to store a number that big for anyway?
Edit A correction - I hilariously underestimated how many digits the number would have. It's over 1e21. I tried
randi([1 9], 1, 1e11)
and Matlab tells me that array would require 750GB of RAM to create. This has made me more curious as to what this number is you're trying to calculate.