How to Clear MATLAB Windows

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to share my knowledge with all of you guys about How to Clear MATLAB Windows. If the command window and workspace window are not clear they present a very complicated look and hence the user feel it difficult to write code on command window. Here, I have compiled a list of awesome MATLAB Image Processing Projects so must check them out to get some inspiration. :) So, for the ease of the user we need to clear the both window specially the command window because it contains the entire code for any of the task. Before going into the details of this tutorial, you should go through Introduction to MATLAB and Declaration of Variables in MATLAB for the better understanding of this tutorial. If we want to avoid the complications while writing the code on command window we must need to clear the both command window as well as the workspace window. If you don't wanna work on Command Windows then you should have a look at How to Create m File in MATLAB.  Anyways, in today's tutorial we are gonna have a look at matlab clear command window and its quite easy but I must say its quite handy, especially when you are working on some complex MATLAB Project.. So, now let's get started with today's tutorial and have a look at How to Clear MATLAB Windows:

How to Clear MATLAB Windows ???

In the tutorial, Clearing MATLAB Windows I will show that which commands are required to use to clear the command window and workspace window In order to avoid the complications for the user while writing the source code on the command window.
  • The commands for clearing the command window and workspace window are shown below.
  1. clear all (used to clear the workspace window)
  2. clc (used to clear the entire command window)
  • The command window with some of the commands written on it is shown in the figure below.
  • The workspace window having some of the variables is shown in the figure below.
Clearing both the Windows
  • First of all I will show you that how to clear the workspace window.
  • Go to the command window and write the command clear all and press
  • All of the above steps are shown in the figure below.
  • You will see that all the variables from the workspace window has been removed.
  • The cleared workspace window is shown in the figure below.
  • Now go to the command window and write the command clc on it.
  • The command written on the command window is shown in the figure below.
  • If you press Enter after writing the command show in the figure above, on the command, you will see that the command window has be cleared.
  • The empty command window is shown in the figure below.
  • So, by clearing both of these window a user can easily make an algorithm without any complication.
  • You should also have a look at this video tutorial as well:
That is all from the tutorial, Clearing Command Window and Workspace in MATLAB. I hope you enjoyed this tutorial. If you face any sort of problem in clear command window matlab, you can ask me in comments anytime without even feeling any kind of hesitation. I will try my level best to solve your issues in a better way, if possible. In my next tutorial I will explain you that how to Calculate the Values of the Trigonometric Functions in MATLAB. I will explore MATLAB further in my later tutorials and will share all of them with all of you as well. So, till then, Take Care :)

Creating First Program with myRIO

Hello everyone! I hope you all will be absolutely fine and having fun. Today, I am going to share my knowledge about Creating First Program with myRIO. Before doing anything on NI myRIO you must know that how to configure this device. So, before going into the details of this tutorial I would like to suggest you to must visit Getting Started with myRIO and How to Configure myRIO on WiFi for the better understanding of this tutorial. NI myRIO is an amazing processing tool that has a very high processing speed as compared to other microcontroller e.g. Arduino, raspberry pi, gellilio etc. So, it can be used for the real time projects where there is need to respond very quickly according to the assigned tasks. NI myRIO was launched by National Instrument. It has different models. In this tutorial I am going to use NI myRIO. This module has a built-in Wifi as well as USB cable supported. The device has its own IP address which helps while configuring it. If we want tmo connect it over internet then the IP address changes to access the device online. It operates on 667MHz. It’s a fully secured device with a strong casing around the circuitry. There are on board four LED lights on NI myRIO for the configuration test, whether the device is properly attached to the computer or not.

Creating First Program with myRIO

Here, in the tutorial Creating First Program with myRIO, I will tell you the step by step procedure for creating your first program using NI myRIO. The tutorials basically focuses on controlling an LED on Front Panel with the help of the on board button on the device.
  • You can download the complete Virtual Instrument (VI) for controlling LED using on board button here by clicking on the button below.
  • Download .rar file, extract it and enjoy the LabVIEW NI myRIO’s simulation.

Virtual Instrument (VI) Creation
  • First of all open the NI LabVIEW software from the softwares list.
  • The starting window of the software is shown in the figure below.
  • You can see a lot of options on the starting window having different individual functions.
  • Now, click on the encircled button Create Project.
  • As you press this button a new window will be appeared on your computer screen.
  • The new window with multiple options is shown in the figure below.
  • Go to the myRIO option as shown in the figure below.
  • While clicking on myRIO option, you can see the display on the right side will change by doing so.
  • Select the myRIO Project from the right portion of the window.
  • The both of the above steps are shown in the figure below.
  • Now, press the Next button as shown in the figure below.
  • Just after pressing this button you will be able to see a new window on your computer’s screen.
  • Select the Plugged into USB option and press Refresh button, your attached myRIO device will be detected in this way.
  • IP address of the used NI myRIO is encircled in the below figure as 22. 11.2.
  • The newly opened window with a bit detail is shown in the figure below.
  • The destination of the file which is being created is shown in the figure below.
  • Now, press the Finish button as highlighted in the figure shown below.
  • As you press this button a new window will again appear on your computer’s screen.
  • Go to the Medical Kit (172.22.11.2) as encircled in the figure below.
  • The new window appeared with all of the above steps is shown in the figure below.
  • Now go to the Medical Kit option and Right Click on it.
  • By doing so, you can see a lot of options here in the new mini window, go to New-> VI.
  • The above steps are shown in the figure given below.
  • As u press the VI two windows, Front Panel and Block Diagram will be appeared on your computer’s screen.
  • Both the windows are shown in the figure below.
  • Now, press Ctrl+t, both of the windows will be aligned in this way.
  • Now go to the Block Digram window and Right Click on it.
  • Go to the Functions-> Programming-> Structures here you can see different structures blocks.
  • Select the While Loop as encircled in the figure shown below.
  • Select this block and place it on the Block Diagram window as shown I the figure below.
  • Now, go to the Functions-> Programming-> Structures once again.
  • Select the Flat Sequence and place it around the While Loop.
  • Now put your cursor on the right side of the Flat Sequence and Right Click on it.
  • Go to the Add Frame After as shown in the figure below.
  • Now, Right Click on the Block Diagram window and go to Functions-> myRIO-> Device Management, here you can see the two different management blocks.
  • Select the encircled block Reset myRIO as shown in the figure below.
  • Place the encircled block Reset myRIO inside the second frame of the Flat Sequence.
  • Now go to the Functions-> myRIO and here you can see the different myRIO blocks.
  • Select the encircled block Button as shown in the figure below.
  • Place Button inside the While Loop.
  • As you place the button a new window will be appeared on your screen.
  • New window is shown in the figure below, just press Ok as shown below.
  • All of the above steps are shown in the figure below.
  • Now go the Functions-> Programming-> Structures, here you can see the different structure blocks.
  • Select the encircled block Case Structure as shown in the figure below.
  • Now go to the Functions-> myRIO, here you will see a lot of myRIO blocks.
  • Select the encircled block LED as shown in the figure below.
  • Select the encircled block and place it inside the Case Structure.
  • As you place the LED in the Case Structure a new window will be appeared on the screen, just press Ok.
  • The figure shown below exhibits the above steps.
  • Now to the First input terminal of the LED and Right Click on it and go to Create-> Constant.
  • By doing so, four inputs will be added to the LED.
  • The above step is shown in the figure below.
  • And change the condition from False to the True e.g. F to
  • The figure shown below exhibits the above step.
  • Now copy the entire code inside the Case Structure and go to the False Option.
  • Paste the copied code inside the False Option and change the condition from True to False i.e. form T to
  • The above step is shown in the figure below.
  • Now go to the bottom right of the While Loop and go to Create-> Control as shown in the figure below.
  • Now go to output terminal of the Button right click on it.
  • Go to the Create-> Indicator as shown in the figure below.
  • By doing so, a new indicator will be added on the block diagram window to show the state of the button i.e. whether it is pressed or not.
  • The above step is exhibited in the figure below.
  • Now run the program and the code will be started to upload on the NI myRIO.
  • The uploading in process is shown in the figure below.
 
  • The Front Panel is shown in the figure below.
  • Now if you press the button on the myRIO the Green LED on the Front Panel will be turned on.
  • The figure shown below exhibits the above step.
  • The ON state of the LED shows that the button on the myRIO is pressed.
So, that is all from the tutorial Creating First Program with myRIO. I hope you enjoyed this first project with myRIO. You should also have a look at these LabView Projects. If you find any sort of problem, you can ask in comments anytime without even feeling any kind of hesitation. I will try my level best to solve your issues in a better way, if possible. In my next tutorial I will elaborate that how to control the servo motor using NI LabVIEW and NI myRIO. I will further explore NI LabVIEW and NI myRIO in my later tutorials. So, till then, Take Care :)
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir