Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
How do I only result in 5 answers (I want the matrix to times 1 by 1 and 2 by 2 and 3 by 3 etc. not 1 by 1 and 1 by 2 and 1 by 3 etc.)
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
s = 1;
s1 = input('Enter the number of columns : ');
h = 1;
h1 = input('Enter the number of columns : ');
for p = 1:s
    for c=1:s1
        fprintf('Enter the value in row %d column %d\n',p,c);
        M(p,c)=input('');
    end
end
disp(M)
for i = 1:h
    for j = 1:h1
        fprintf('Enter the value in row %d column %d\n',i,j);
        M1(i,j)=input('');
    end
end
disp(M1)
for i = 1:5
    for j = 1:5
        s1 = M(i);
        h1 = M1(j);
    SA = ((sqrt(3)./2) * s1^2 + 3*s1*h1);
    fprintf ("\nTotal surface area of equilateral triangular prism is %f\n",SA)
    end
end
0 Commenti
Risposte (0)
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!