dc motor to arduino uno/ NO ADAFRUIT OR MKR

Hello, I am having trouble with my dc motor connected to arduino uno. im using matlab but nothing i try is working. Does anyone have any tips?

hybridzfc:
Does anyone have any tips?

Yes.
Read the posts at the top of this forum for guidance on how to use this forum.
It covers many useful topics like

How to post code using code tags.
Because without posting your code, we can't help you much.

How to post links.
Because liks to the motor and driver you have will help us help you.

Hot to post images.
Because an image of your hand drawn wiring diagram will help us help you.

clear;clc;
a=arduino();
d=dcmotor(a,'D9');

while true
writeDigitalPin(a,'D9',1);
start(d)
end

this is my matlab code but everytime i run it, it gives me an error. I just need it to spin.

hybridzfc:
clear;clc;
a=arduino();
d=dcmotor(a,'D9');

while true
writeDigitalPin(a,'D9',1);
start(d)
end

this is my matlab code but everytime i run it, it gives me an error. I just need it to spin.

Do suppose telling the forum people what the error actually is might be important to getting help?

Paul

Attempt to execute SCRIPT dcmotor as a function:
dcmotor.m

Error in dcmotor (line 3)
d=dcmotor(a,'D9');