⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rs.m

📁 Reed Solomon码的编译码器MATLAB仿真程序
💻 M
📖 第 1 页 / 共 2 页
字号:
% 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 edit12_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit12 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit12_Callback(hObject, eventdata, handles)% hObject    handle to edit12 (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 edit12 as text%        str2double(get(hObject,'String')) returns contents of edit12 as a double% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton3 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
value= str2num(get(handles.edit19,'string'));
site= str2num(get(handles.edit21,'string'));
r_x= str2num(get(handles.edit6,'string'));
out= rs_decode (r_x,site,value);
set(handles.edit13,'string',num2str(out));% --- Executes during object creation, after setting all properties.function edit13_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit13 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit13_Callback(hObject, eventdata, handles)% hObject    handle to edit13 (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 edit13 as text%        str2double(get(hObject,'String')) returns contents of edit13 as a double% --- 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)
x1= str2num(get(handles.edit1,'string'));
x2= str2num(get(handles.edit7,'string'));
y= rs_symboladd(x1,x2);
set(handles.edit8,'string',num2str(y));% --- 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)
x1= str2num(get(handles.edit1,'string'));
x2= str2num(get(handles.edit7,'string'));
y= rs_symbolminus(x1,x2);
set(handles.edit9,'string',num2str(y));% --- Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton6 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
x1= str2num(get(handles.edit1,'string'));
x2= str2num(get(handles.edit7,'string'));
y= rs_symboldiv(x1,x2);
set(handles.edit11,'string',num2str(y));% --- Executes on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton7 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
x1= str2num(get(handles.edit1,'string'));
x2= str2num(get(handles.edit7,'string'));
y1= rs_symbolrev(x1);
y2= rs_symbolrev(x2);
set(handles.edit12,'string',num2str(y1));
set(handles.edit14,'string',num2str(y2));% --- Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton8 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
x1= str2num(get(handles.edit1,'string'));
x2= str2num(get(handles.edit7,'string'));
y= rs_symbolmultiple(x1,x2);
set(handles.edit10,'string',num2str(y));% --- Executes during object creation, after setting all properties.function edit14_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit14 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit14_Callback(hObject, eventdata, handles)% hObject    handle to edit14 (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 edit14 as text%        str2double(get(hObject,'String')) returns contents of edit14 as a double% --- Executes on button press in pushbutton9.function pushbutton9_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton9 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
r_x= str2num(get(handles.edit6,'string'));
synd_x=rs_decode_syndrome(r_x);
set(handles.edit16,'string',num2str(synd_x));

% --- Executes during object creation, after setting all properties.function edit16_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit16 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit16_Callback(hObject, eventdata, handles)% hObject    handle to edit16 (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 edit16 as text%        str2double(get(hObject,'String')) returns contents of edit16 as a double% --- Executes on button press in pushbutton10.function pushbutton10_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton10 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
sigma_x= str2num(get(handles.edit18,'string'));
root=rs_decode_root(sigma_x);   
set(handles.edit17,'string',num2str(root));
% --- Executes during object creation, after setting all properties.function edit17_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit17 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit17_Callback(hObject, eventdata, handles)% hObject    handle to edit17 (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 edit17 as text%        str2double(get(hObject,'String')) returns contents of edit17 as a double% --- Executes on button press in pushbutton11.function pushbutton11_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton11 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
synd_x= str2num(get(handles.edit16,'string'));
sigma_x=rs_decode_iterate(synd_x);
set(handles.edit18,'string',num2str(sigma_x));% --- Executes during object creation, after setting all properties.function edit18_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit18 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit18_Callback(hObject, eventdata, handles)% hObject    handle to edit18 (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 edit18 as text%        str2double(get(hObject,'String')) returns contents of edit18 as a double% --- Executes on button press in pushbutton12.function pushbutton12_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton12 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
t_x= str2num(get(handles.edit3,'string'));
Position= str2num(get(handles.edit4,'string'));
ERROR= str2num(get(handles.edit5,'string'));
N=3;
[E,r_x] =rs_channel(t_x,N,Position,ERROR);
set(handles.edit19,'string',num2str(E));
% --- Executes during object creation, after setting all properties.function edit19_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit19 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit19_Callback(hObject, eventdata, handles)% hObject    handle to edit19 (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 edit19 as text%        str2double(get(hObject,'String')) returns contents of edit19 as a double% --- Executes on button press in pushbutton13.function pushbutton13_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton13 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
synd_x= str2num(get(handles.edit16,'string'));
sigma_x= str2num(get(handles.edit18,'string'));
root= str2num(get(handles.edit17,'string'));
[value,site]=rs_decode_forney(synd_x,sigma_x,root);
set(handles.edit20,'string',num2str(value));% --- Executes during object creation, after setting all properties.function edit20_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit20 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit20_Callback(hObject, eventdata, handles)% hObject    handle to edit20 (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 edit20 as text%        str2double(get(hObject,'String')) returns contents of edit20 as a double% --- Executes on button press in pushbutton14.function pushbutton14_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton14 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
synd_x= str2num(get(handles.edit16,'string'));
sigma_x= str2num(get(handles.edit18,'string'));
root= str2num(get(handles.edit17,'string'));
[value,site]=rs_decode_forney(synd_x,sigma_x,root);
set(handles.edit21,'string',num2str(site));% --- Executes during object creation, after setting all properties.function edit21_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit21 (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    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit21_Callback(hObject, eventdata, handles)% hObject    handle to edit21 (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 edit21 as text%        str2double(get(hObject,'String')) returns contents of edit21 as a double

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -