multiplication table in matlab
显示 更早的评论
I want to make the multiplication table using matlab ?
2 个评论
Azzi Abdelmalek
2013-3-1
What does that mean?
leela krishna
2019-6-30
the output is the multiplication table of any number
clc;
clear all;
n=input('Enter an integer:');
i=1;
while(i<=10)
fprintf('%d*%d=%d \n',n,i,n*i);
i=i+1;
end
采纳的回答
更多回答(4 个)
John Doe
2013-5-22
Another one-liner:
cumsum(meshgrid(1:10))
Teja Muppirala
2013-5-23
N = 10
(1:N)'*(1:N)
2 个评论
Morganne Durham
2018-1-22
To make a matrix for a times table, you need to use a period before the *
(1:N)'.*(1:N)
Matt J
2013-3-1
As an example, This will generate a times table for integers 1...10
bsxfun(@times, (1:10).',1:10)
类别
在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!