writing a skript on matlab

Write a script to display all numbers between 0 and 100 as long as it is not divisible by 2 or not equal to 50.

Respuestas (1)

Vinai Datta Thatiparthi
Vinai Datta Thatiparthi el 12 de Abr. de 2020

0 votos

in = 0:100; % Create an array of numbers from 0 to 100
out = in( (mod(in,2)~=0) & (in~=50)) % Out contains numbers that are not even & not 50
Here are some Documentation links to help you ramp-up on the basic array/matrix operations on MATLAB -
Hope this helps!

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de Abr. de 2020

Respondida:

el 12 de Abr. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by