Error using .* Matrix dimensions must agree.
显示 更早的评论
Hi,
I got a trouble when I tried to load the date file and update the new balance.
Here is my atm.mat file
password = 'ucsdmate'
balance = num1str(9.5405*100,'%10.2f%')
recentdate= datenum(now)
rate = num2str(0.02*100,'%5.2f%%')
And here is what my problem.
firstdate = datenum(2012,11,04);
days = abs(recentdate - firstdate);
newbalance = balance.*((1+rate).^days);
disp ('Your balance from %d is %10.2f',firstdate,newbalance)
It said Error using .* Matrix dimensions must agree. I don't know where the problem is, I have already used .* but it still didnt work for me
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Time Series Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!