Matlab R2016b

3 次查看(过去 30 天)
Inna Kogan
Inna Kogan 2017-9-2
回答: Niguse 2025-5-15
Hi I need to install matlab R2016b so it is compatible with CVX. How do I buy one? mathworks seems to offer only the latest license (R2017A). thanks

回答(3 个)

KALYAN ACHARJYA
KALYAN ACHARJYA 2017-9-2
Yes, Matlab R2016b is compatible with CVX. You can get it from your lab instructor(licensed).

ANN MARIYA PETER ANN MARIYA PETER
t=0:0.1:10
alpha=2
ramp=alpha*t % Your input signal
model=tf(1,[1 20 3]); % Your transfer function
[y,t]=lsim(model,ramp,t)
plot(t,y)

Niguse
Niguse 2025-5-15
clc;
clear;
close all;
%% Parameters
N = 64; % Number of OFDM subcarriers
cp_len = 16; % Cyclic prefix length
num_symbols = 1000; % Number of OFDM symbols
SNR_dB = 0:2:30; % SNR range
mod_schemes = {'BPSK', 'DPSK', 'QPSK'}; % Modulation types
% PLC multipath channel model
plc_channel = [0.9 0.5 0.3];
% Colored noise filter (1st order lowpass)
b_noise = [1 -0.5];
a_noise = [1];
%% Initialize BER result
ber = zeros(length(mod_schemes), length(SNR_dB));
%% Main Simulation
for m = 1:length(mod_schemes)
mod_type = mod_schemes{m};
for idx = 1:length(SNR_dB)
snr = SNR_dB(idx);
total_err = 0;
total_bits = 0;
for sym = 1:num_symbols
%% Data Generation and Modulation
switch mod_type
case 'BPSK'
bits = randi([0 1], N, 1);
symbols = 2*bits - 1; % BPSK: 0→-1, 1→+1
case 'DPSK'
bits = randi([0 1], N, 1);
symbols = dpskmod(bits, 2); % DPSK modulation
case 'QPSK'
bits = randi([0 1], 2*N, 1);
symbols = qammod(bits, 4, 'InputType', 'bit', 'UnitAveragePower', true);
end
%% OFDM Modulation (IFFT + Cyclic Prefix)
ofdm_sym = ifft(symbols, N);
tx_signal = [ofdm_sym(end-cp_len+1:end); ofdm_sym]; % Add cyclic prefix
%% Channel with Colored Noise
chan_out = conv(tx_signal, plc_channel, 'same');
white_noise = randn(size(chan_out));
colored_noise = filter(b_noise, a_noise, white_noise);
noise_power = var(chan_out) / (10^(snr/10));
colored_noise = sqrt(noise_power) * colored_noise;
rx_signal = chan_out + colored_noise;
%% Receiver
rx_no_cp = rx_signal(cp_len+1:cp_len+N); % Remove CP
rx_fft = fft(rx_no_cp, N); % FFT
%% Demodulation
switch mod_type
case 'BPSK'
rx_bits = real(rx_fft) > 0;
total_err = total_err + sum(bits ~= rx_bits);
case 'DPSK'
rx_bits = dpskdemod(rx_fft, 2); % DPSK demodulation
total_err = total_err + sum(bits ~= rx_bits);
case 'QPSK'
rx_bits = qamdemod(rx_fft, 4, 'OutputType', 'bit', 'UnitAveragePower', true);
total_err = total_err + sum(bits ~= rx_bits);
end
% Bit count
switch mod_type
case 'QPSK'
total_bits = total_bits + length(bits);
otherwise
total_bits = total_bits + N;
end
end
ber(m, idx) = total_err / total_bits;
end
end
%% Plotting
figure;
semilogy(SNR_dB, ber(1,:), 'r-o', 'LineWidth', 2); hold on;
semilogy(SNR_dB, ber(2,:), 'b-s', 'LineWidth', 2);
semilogy(SNR_dB, ber(3,:), 'g-^', 'LineWidth', 2);
grid on;
xlabel('SNR (dB)');
ylabel('Bit Error Rate (BER)');
legend('BPSK', 'DPSK', 'QPSK', 'Location', 'southwest');
title('Performance Comparison of OFDM over PLC Channel with Colored Noise');
%% Save the Figure
saveas(gcf, 'OFDM_BER_PLC_Colored_Noise.png'); % PNG format
saveas(gcf, 'OFDM_BER_PLC_Colored_Noise.fig'); % MATLAB figure format
give me the figure for thiscode

类别

Help CenterFile Exchange 中查找有关 PHY Components 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by