📄 patchui2.m
字号:
% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit3_Callback(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit3 as text% str2double(get(hObject,'String')) returns contents of edit3 as a doubleglobal dzdz= str2num(get(hObject,'String'));% --- Executes during object creation, after setting all properties.function edit3_CreateFcn(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit4_Callback(hObject, eventdata, handles)% hObject handle to edit4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit4 as text% str2double(get(hObject,'String')) returns contents of edit4 as a doubleglobal erer= str2num(get(hObject,'String'));% --- Executes during object creation, after setting all properties.function edit4_CreateFcn(hObject, eventdata, handles)% hObject handle to edit4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit5_Callback(hObject, eventdata, handles)% hObject handle to edit5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit5 as text% str2double(get(hObject,'String')) returns contents of edit5 as a doubleglobal dydy= str2num(get(hObject,'String'));% --- Executes during object creation, after setting all properties.function edit5_CreateFcn(hObject, eventdata, handles)% hObject handle to edit5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit6_Callback(hObject, eventdata, handles)% hObject handle to edit6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit6 as text% str2double(get(hObject,'String')) returns contents of edit6 as a doubleglobal dxdx= str2num(get(hObject,'String'));% --- Executes during object creation, after setting all properties.function edit6_CreateFcn(hObject, eventdata, handles)% hObject handle to edit6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end% --- Executes on slider movement.function slider5_Callback(hObject, eventdata, handles)% hObject handle to slider5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'Value') returns position of slider% get(hObject,'Min') and get(hObject,'Max') to determine range of sliderglobal EE= round(get(hObject,'Value'));set(hObject,'Value', E);h1=findobj('Tag','text26');set(h1,'String', num2str(E));setspace;% --- Executes during object creation, after setting all properties.function slider5_CreateFcn(hObject, eventdata, handles)% hObject handle to slider5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: slider controls usually have a light gray background.if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor',[.9 .9 .9]);endfunction edit7_Callback(hObject, eventdata, handles)% hObject handle to edit7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit7 as text% str2double(get(hObject,'String')) returns contents of edit7 as a doubleglobal fftstartfftstart = str2num(get(hObject,'String'));% --- Executes during object creation, after setting all properties.function edit7_CreateFcn(hObject, eventdata, handles)% hObject handle to edit7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit8_Callback(hObject, eventdata, handles)% hObject handle to edit8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit8 as text% str2double(get(hObject,'String')) returns contents of edit8 as a doubleglobal fftstopfftstop = str2num(get(hObject,'String'));% --- Executes during object creation, after setting all properties.function edit8_CreateFcn(hObject, eventdata, handles)% hObject handle to edit8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit9_Callback(hObject, eventdata, handles)% hObject handle to edit9 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit9 as text% str2double(get(hObject,'String')) returns contents of edit9 as a double% --- Executes during object creation, after setting all properties.function edit9_CreateFcn(hObject, eventdata, handles)% hObject handle to edit9 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit10_Callback(hObject, eventdata, handles)% hObject handle to edit10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit10 as text% str2double(get(hObject,'String')) returns contents of edit10 as a double% --- Executes during object creation, after setting all properties.function edit10_CreateFcn(hObject, eventdata, handles)% hObject handle to edit10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit11_Callback(hObject, eventdata, handles)% hObject handle to edit11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit11 as text% str2double(get(hObject,'String')) returns contents of edit11 as a double% --- Executes during object creation, after setting all properties.function edit11_CreateFcn(hObject, eventdata, handles)% hObject handle to edit11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end% --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global dx dy dze0=8.8541878176*10^-12;mu0=(4*pi)*10^-7;v0=1./sqrt(e0*mu0);er=str2num(get(findobj('Tag','edit9'),'String'))h=str2num(get(findobj('Tag','edit10'),'String'))*10^-3;fr=str2num(get(findobj('Tag','edit11'),'String'))*10^9;w=(v0/(2*fr))*sqrt(2/(er+1));ereff=((er+1)/2)+((er-1)/2)*(1+12*(h/w))^(-.5);dl=(h*0.412)*(ereff+0.3)*((w/h)+0.264)/((ereff-0.258)*((w/h)+0.8));l=(1/(2*fr*sqrt(ereff)*sqrt(mu0*e0)))-(2*dl);set(findobj('Tag','edit12'),'String',num2str(w/10^-3));set(findobj('Tag','edit13'),'String',num2str(l/10^-3));set(findobj('Tag','edit14'),'String',num2str(sprintf('%2.2f',h*10^3/dz)));set(findobj('Tag','edit15'),'String',num2str(sprintf('%2.2f',l*10^3/dy)));set(findobj('Tag','edit16'),'String',num2str(sprintf('%2.2f',w*10^3/dx)));%Calculate feed widthz0=0;w2=0.000;t=0.035*10^-3;while ((abs(z0-50) > 0.01) )w2=w2+0.00001; w=w2*10^-3; if ((w/h) < 1) ereff=((er+1)/2)+((er-1)/2)*((1+12*(h/w))^(-.5) + (0.04*(1-(w/h)^2))); else ereff=((er+1)/2)+((er-1)/2)*(1+12*(h/w))^(-.5); end dw=(t/pi)*log((4*exp(1))/ sqrt((t/h)^2 + ((1/pi)/(w/t+1.1))^2 )); dwp=dw*((1+(1/ereff))/2); wp=w+dwp; a1=(120*pi)/(2*pi*sqrt(2*(1+er))); a2=(4*h)/wp; a3=(14+(8/ereff))/11; a4=sqrt((a3*a2)^2+(pi^2*(1+(1/ereff))/2)); z0=a1*log(1+a2*(a3*a2+a4)); endset(findobj('Tag','edit17'),'String',num2str(sprintf('%2.4f',w*10^3)));set(findobj('Tag','edit18'),'String',num2str(sprintf('%2.2f',w*10^3/dx)));% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject handle to pushbutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global dx dy dze0=8.8541878176*10^-12;mu0=(4*pi)*10^-7;v0=1./sqrt(e0*mu0);er=str2num(get(findobj('Tag','edit9'),'String'))h=str2num(get(findobj('Tag','edit10'),'String'))*10^-3;l=str2num(get(findobj('Tag','edit13'),'String'))*10^-3;w=str2num(get(findobj('Tag','edit12'),'String'))*10^-3;ereff=((er+1)/2)+((er-1)/2)*(1+12*(h/w))^(-.5)dl=(h*0.412)*(ereff+0.3)*((w/h)+0.264)/((ereff-0.258)*((w/h)+0.8))fr=1/((l+(2*dl))*(2*sqrt(ereff)*sqrt(mu0*e0)))set(findobj('Tag','edit11'),'String',num2str(fr/10^9));set(findobj('Tag','edit14'),'String',num2str(sprintf('%2.2f',h*10^3/dz)));set(findobj('Tag','edit15'),'String',num2str(sprintf('%2.2f',l*10^3/dy)));set(findobj('Tag','edit16'),'String',num2str(sprintf('%2.2f',w*10^3/dx)));%Calculate feed widthz0=0;w2=0.000;t=0.035*10^-3;while ((abs(z0-50) > 0.01) )w2=w2+0.00001; w=w2*10^-3;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -