how to write in edit field

조회 수: 141(최근 30일)
naouras saleh
naouras saleh 2019년 11월 4일
댓글: naouras saleh 2019년 11월 6일
i'm new to matlab can you help me
in app designer i want to write ip address in edit field
here is the showen function, what i have to write inside it?
function CameraIPEditFieldValueChanged(app, event)
thank you

채택된 답변

Katie 2019년 11월 4일
Hi! What you're showing in your question is the callback function for the CamperaIP edit field. This function is called whenever you type something new into that edit field while running your app. If you're interested in storing whatever you type into this field for use in other parts of the app, you could have a property (for example, let's call the property "CameraIP") that you store the edit field value in. Then in the callback function you are showing, you could do the following:
function CameraIPEditFieldValueChanged(app, event)
In this function, the property "CameraIP" will get updated anytime you type something new into this edit field. Then in other places throughout the app, you can reference app.CameraIP to use whatever value is stored in this property.
If you want to have a starting IP address in that edit field, in your startupFcn callback you could do the following:
function startupFcn(app)
app.CameraIPEditField.value='';%enter whatever IP address you want here
Whenever you run the app, your edit field will start out filled with this IP address.
If you're having trouble writing new values to this edit field, make sure the edit field component is set as "editable." You can field this option in the Component Browser in the Design View within app designer.
Hope this helps!
  댓글 수: 3
naouras saleh
naouras saleh 2019년 11월 6일
Thank you so much I really appreciate it. You helped me alot Now I have better understanding.

댓글을 달려면 로그인하십시오.

추가 답변(1개)

Ajay Kumar
Ajay Kumar 2019년 11월 4일
doc uieditfield


Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by