filename = uigetfiledisplays a modal dialog box that lists files in the current folder and enables you to select or enter the name of a file. If the file name is valid and the file exists,uigetfilereturns the file name as a string when you clickOpen. Otherwiseuigetfiledisplays an appropriate error message, after which control returns to the dialog box. You can then enter another file name or clickCancel. If you clickCancelor close the dialog window,uigetfilereturns0.
Examples
The following statement displays a dialog box for retrieving a file. The dialog box lists all MATLAB code files within a selected directory.uigetfilereturns the name and path of the selected file inFileNameandPathName.uigetfileappendsAll Files(*.*)to the file types whenFilterSpecis a string.
[FileName,PathName] = uigetfile('*.m','Select the MATLAB code file');
The following figure shows the dialog box with the file type drop-down list open.
To create a list of file types that appears in the file type drop-down list, separate the file extensions with semicolons, as in the following code.uigetfiledisplays a default description for each known file type, such as "Model files" for Simulink®.slxand.mdlfiles.
If you want to create a list of file types and give them descriptions that are different from the defaults, use a cell array, as in the following code. This example also associates multiple file types with the'MATLAB Files'and'Models'descriptions.
The first column of the cell array contains the file extensions, while the second contains your descriptions of the file types. In this example, the first entry of column one contains several extensions, separated by semicolons, which are all associated with the description'MATLAB Files (*.m,*.fig,*.mat,*.mdl)'. The code produces the dialog box shown in the following figure.
The following code lets you select a file and then displays a message in the Command Window that summarizes the result.
[filename, pathname] = uigetfile('*.m', 'Select a MATLAB code file');
if isequal(filename,0)
disp('User selected Cancel')
else
disp(['User selected ', fullfile(pathname, filename)])
end
This code creates a list of file types and gives them descriptions that are different from the defaults. It also enables multiple-file selection. Select multiple files by holding down theShiftorCtrlkey and clicking on additional file names.
function userDraw(handles)%F=figure;%setptr(F,'eraser');%a custom cursor just for fun
A=handles.axesUserDraw;% axesUserDraw is tag of my axes
set(A,'buttondownfcn',@start_pencil)function start_pencil(src,eventdata)
coords=get(src,'currentpoint');%since thisis the axes callback, src=gca
x=coords(1,1,1);
y=coords(1,2,1);
r=line(x, y,'color',[0.51],'LineWidth',2,'hittest','off');%turning hittset off allows you to draw new lines that start on top of an existing line.set(gcf,'windowbuttonmotionfcn',{@continue_pencil,r})set(gcf,'windowbuttonupfcn',@done_pencil)function continue_pencil(src,eventdata,r)%Note: src is now the figure handle,not the axes, so we need to use gca.
coords=get(gca,'currentpoint');%this updates every time i move the mouse
x=coords(1,1,1);
y=coords(1,2,1);%get the line's existing coordinates and append the new ones.
lastx=get(r,'xdata');
lasty=get(r,'ydata');
newx=[lastx x];
newy=[lasty y];
set(r,'xdata',newx,'ydata',newy);
function done_pencil(src,evendata)
%all this funciton does is turn the motion function off
set(gcf,'windowbuttonmotionfcn','')
set(gcf,'windowbuttonupfcn','')
참고 : http://we15hang.blogspot.ca/2012/04/matlab-gui-interactive-drawing.html
first go to openingFcn callback and set all uipanel visibile to off except the 1st one which is uipanel1. Here it is just one panel uipanel2
function gui1_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% Choose default command line output for gui1
handles.output = hObject;
set(handles.uipanel2,'Visible','Off');
% Update handles structure
guidata(hObject, handles);
Now go to pushbutton1 (Next Button ) callback and set the uipanel1 visible to off and uipanel2 visible to on. That way when you click on next button, second one will appear and first will disappear. Remember you are just making it in invisible.. All the data which you have entered is as it were.. no harm to them.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.uipanel2,'Visible','On');
set(handles.uipanel1,'Visible','Off');
Do the same for pushbutton2 callback but other way around
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Google is preparing to push the Android 4.2 update to Asus Nexus 7 users. However, if you installed a custom ROM on your tablet, then you aren’t eligible to receive the update therefore you need to find a way to restore your tablet to official firmware. It’s very easy to restore your tablet to the original Android 4.1.2 Jelly Bean software, but you need to follow the steps below carefully.
Right from the start, we have to warn you that this guide only works for the Asus Nexus 7, and if you attempt this on any other device, then you will most likely brick it so just stay away. In order to check your model, go to Settings -> About device. In addition, it’s worth reminding you that you should backup your tablet because all your data will be lost in the process therefore go tothis linkin order to find out how to perform a backup.
How To Restore Google Nexus 7 To Stock Android 4.1.2 Jelly Bean Firmware And Unroot It
1. Download the Nexus Root Toolkit on your PC fromthis link.
2. Open the Nexus Root Toolkit file by double-clicking on the executable. This will install the application on your computer.
3. On your tablet, go toSettings -> Developer Options -> USB Debugging. You have toenable USB debuggingby checking the box right next to it.
4. On your Nexus 7, navigate toSettings -> Security -> Installation from Unknown Sources. You need to alsoenable the Installation from Unknown Sources option. Check the box next to it, and move on.
5. On your PC, open the Nexus Root Toolkit app.
6. Now, it’s time to connect your tablet to your computer using the USB cable.
7. In the NRT application, click onBackup. This will create a backup of your ROM just in case something goes awfully wrong. When the backup is compete, get to the next step.
8. Go back to the main NRT menu, and under theBack to Stocktab, selectDevice is on / Normal.
9. Now, click on theFlash Stock + Unrootbutton.
10. A popup will be displayed, and you will have to click OK.
11. Another message box will be displayed, and here you must select theAndroid 4.1.2 option with build JZ054K. You must also select the following choice:Automatically download + extract the factory image selected above for me.
12. PressOK.
13. The stock Android 4.1.2 build JZ054K image file will begin downloading, and it’s gonna take a while as the file is pretty large. After the download is complete, another pop-up message will be displayed. Here, selectOK, and go ahead with the process.
14. The setup will automatically reboot your tablet, and then boot it in Bootloader mode. Then, it will check Fastboot status in order to detect the device. If it says that the device hasn’t been detected, then you need to cancel the setup, disconnect the tablet from your PC, reconnect, it, and then the setup will resume from Step 11.
15. When the setup has detected your Google Nexus 7, another pop-up box will be displayed, and you need to pressOKin order to continue.
16. A command-prompt windows will show up, and the stock Android 4.1.2 firmware will be flashed on your Asus Nexus 7. When the process is complete, the tablet will also be unrooted, and you will be able to install official OTA updates from Google.
17. The process will once again reboot your tablet, and when you see a message sayingPress any key to exit, it’s safe to close the command-prompt window
Poisson's ratio (), named after Siméon Poisson, is the negative ratio of transverse to axial strain. In fact, when a sample object is stretched (or squeezed), to an extension (or contraction) in the direction of the applied load, it corresponds a contraction (or extension) in a direction perpendicular to the applied load. The ratio between these two quantities is the Poisson's ratio.
When a material is compressed in one direction, it usually tends to expand in the other two directions perpendicular to the direction of compression. This phenomenon is called the Poisson effect. Poisson's ratio (nu) is a measure of the Poisson effect. The Poisson ratio is the ratio of the fraction (or percent) of expansion divided by the fraction (or percent) of compression, for small values of these changes.
Conversely, if the material is stretched rather than compressed, it usually tends to contract in the directions transverse to the direction of stretching. Again, the Poisson ratio will be the ratio of relative contraction to relative stretching, and will have the same value as above. In certain rare cases, a material will actually shrink in the transverse direction when compressed (or expand when stretched) which will yield a negative value of the Poisson ratio.
The Poisson's ratio of a stable, isotropic, linear elastic material cannot be less than −1.0 nor greater than 0.5 due to the requirement that Young's modulus, the shear modulus and bulk modulus have positive values.[1] Most materials have Poisson's ratio values ranging between 0.0 and 0.5. A perfectly incompressible material deformed elastically at small strains would have a Poisson's ratio of exactly 0.5. Most steels and rigid polymers when used within their design limits (before yield) exhibit values of about 0.3, increasing to 0.5 for post-yield deformation (which occurs largely at constant volume.) Rubber has a Poisson ratio of nearly 0.5. Cork's Poisson ratio is close to 0: showing very little lateral expansion when compressed. Some materials, mostly polymer foams, have a negative Poisson's ratio; if these auxetic materials are stretched in one direction, they become thicker in perpendicular directions. Some anisotropic materials have one or more Poisson ratios above 0.5 in some directions.
Assuming that the material is stretched or compressed along the axial direction (the x axis in the below diagram):
where
is the resulting Poisson's ratio,
is transverse strain (negative for axial tension (stretching), positive for axial compression)
is axial strain (positive for axial tension, negative for axial compression).
On the molecular level, Poisson’s effect is caused by slight movements between molecules and the stretching of molecular bonds within the material lattice to accommodate the stress. When the bonds elongate in the direction of load, they shorten in the other directions. This behavior multiplied many times throughout the material lattice is what drives the phenomenon.
Figure 1: A cube with sides of length L of an isotropic linearly elastic material subject to tension along the x axis, with a Poisson's ratio of 0.5. The green cube is unstrained, the red is expanded in the x direction by due to tension, and contracted in the y and z directions by .
For a cube stretched in the x-direction (see figure 1) with a length increase of in the x direction, and a length decrease of in the y and z directions, the infinitesimal diagonal strains are given by:
Integrating the definition of Poisson's ratio:
Solving and exponentiating, the relationship between and is found to be:
For very small values of and , the first-order approximation yields:
Figure 2: Comparison between the two formulas, one for small deformations, another for large deformations
If a rod with diameter (or width, or thickness) d and length L is subject to tension so that its length will change by ΔL then its diameter d will change by:
The above formula is true only in the case of small deformations; if deformations are large then the following (more precise) formula can be used:
where
is original diameter
is rod diameter change
is Poisson's ratio
is original length, before stretch
is the change of length.
The value is negative because it decrease with increase of length
For a linear isotropic material subjected only to compressive (i.e. normal) forces, the deformation of a material in the direction of one axis will produce a deformation of the material along the other axis in three dimensions. Thus it is possible to generalize Hooke's Law (for compressive forces) into three dimensions:
is Young's modulus (the same in all directions: , and for isotropic materials)
is Poisson's ratio (the same in all directions: , and for isotropic materials)
These equations will hold in the general case which includes shear forces as well as compressive forces, and the full generalization of Hooke's law is given by:
is the shear modulus in direction on the plane whose normal is in direction
is the Poisson's ratio that corresponds to a contraction in direction when an extension is applied in direction .
The Poisson's ratio of an orthotropic material is different in each direction (x, y and z). However, the symmetry of the stress and strain tensors implies that not all the six Poisson's ratios in the equation are independent. There are only nine independent material properties; three elastic moduli, three shear moduli, and three Poisson's ratios. The remaining three Poisson's ratios can be obtained from the relations
From the above relations we can see that if then . The larger Poisson's ratio (in this case ) is called the major Poisson's ratio while the smaller one (in this case ) is called the minor Poisson's ratio. We can find similar relations between the other Poisson's ratios.
Transversely isotropic materials have a plane of symmetry in which the elastic properties are isotropic. If we assume that this plane of symmetry is , then Hooke's law takes the form[4]
where we have used the plane of symmetry to reduce the number of constants, i.e., .
The symmetry of the stress and strain tensors implies that
This leaves us with six independent constants . However, transverse isotropy gives rise to a further constraint between and which is
Therefore, there are five independent elastic material properties two of which are Poisson's ratios. For the assumed plane of symmetry, the larger of and is the major Poisson's ratio. The other major and minor Poisson's ratios are equal.
[edit]Poisson's ratio values for different materials
Influences of selected glass component additions on Poisson's ratio of a specific base glass.[5]
Some materials known as auxetic materials display a negative Poisson’s ratio. When subjected to positive strain in a longitudinal axis, the transverse strain in the material will actually be positive (i.e. it would increase the cross sectional area). For these materials, it is usually due to uniquely oriented, hinged molecular bonds. In order for these bonds to stretch in the longitudinal direction, the hinges must ‘open’ in the transverse direction, effectively exhibiting a positive strain.[6] This can also be done in a structured way and lead to new aspects in material design as for Mechanical Metamaterials.
One area in which Poisson's effect has a considerable influence is in pressurized pipe flow. When the air or liquid inside a pipe is highly pressurized it exerts a uniform force on the inside of the pipe, resulting in a radial stress within the pipe material. Due to Poisson's effect, this radial stress will cause the pipe to slightly increase in diameter and decrease in length. The decrease in length, in particular, can have a noticeable effect upon the pipe joints, as the effect will accumulate for each section of pipe joined in series. A restrained joint may be pulled apart or otherwise prone to failure.[citation needed]
Another area of application for Poisson's effect is in the realm of structural geology. Rocks, like most materials, are subject to Poisson's effect while under stress. In a geological timescale, excessive erosion or sedimentation of Earth's crust can either create or remove large vertical stresses upon the underlying rock. This rock will expand or contract in the vertical direction as a direct result of the applied stress, and it will also deform in the horizontal direction as a result of Poisson's effect. This change in strain in the horizontal direction can affect or form joints and dormant stresses in the rock.[7]
The use of cork as a stopper for wine bottles is the result of the fact that cork has a Poisson ratio of practically zero. This means that, as the cork is inserted into the bottle, the upper part which is not yet inserted will not expand as the lower part is compressed. The force needed to insert a cork into a bottle arises only from the compression of the cork and the friction between the cork and the bottle. If the stopper were made of rubber, for example, (with a Poisson ratio of about 1/2), there would be a relatively large additional force required to overcome the expansion of the upper part of the rubber stopper.
Steps as follows :
1. Back up your original wpa_supplicant file (copy to "wpa_supplicant.orig" or something like that).
2. Note the file permissions ("rwxr-xr-x").
3. Copy in the new wpa_supplicant.
4. Change permissions on the new wpa_supplicant to the same as the old.
5. Reboot.