defining variable in matlab

hi can i define a constant in matlab? if yes how can do that
thank u all

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 22 Feb 2013
Edited: Azzi Abdelmalek on 22 Feb 2013
You have not to define it in Matlab. You can pre-allocate
a=0
%or for a vector
a=zeros(10,1)
% or for a matrix
a=zeros(10)
Nermeen alami
Nermeen alami on 22 Feb 2013
thanks a lot :) it works

1 Comment

Mark it as "Accepted" then, as well as for any other questions you have posted. Also, your message here should have been a Comment to Azzi's Answer, not an Answer in itself.

This question is closed.

Tags

Asked:

on 22 Feb 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!