Homework help.(User defined functions )
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ahmad Farghaly
el 2 de Abr. de 2020
Editada: Ahmad Farghaly
el 2 de Abr. de 2020
Can anyone help me figure out this homework.
function [add,sub] = Add_Subtract (M1,M2)
add = M1 + M2 ;
sub = M1 - M2 ;
end
This is what's requierd in the homework (Write a MATLAB User defined function code to calculate both the subtraction and addition of 2 matrices (it should check the dimensions of both matrices and return dimensions error if the dimensions does not match)
I know how to write the function and this is what I've done so far
But what i can't understand is how to make the function check the dimensions of both matrices and return dimensions error if the dimensions do not match
0 comentarios
Respuesta aceptada
James Tursa
el 2 de Abr. de 2020
Hint: See these functions:
doc size
doc isequal
doc error
1 comentario
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!