Define a variable without assigning a value

조회 수: 81 (최근 30일)
Rayan EL-KHOLDI
Rayan EL-KHOLDI 2020년 5월 24일
댓글: Matt J 2024년 2월 7일
Hi,
I want to create a variable m without assigning it a value, and do a calculation with it, is it possible?
Thnak you in advance,
R

답변 (2개)

Matt J
Matt J 2020년 5월 24일
Perhaps you are trying to do symbolic computations,
If so, you need the Symbolic Math Toolbox.
  댓글 수: 2
Jo Do
Jo Do 2022년 11월 9일
Thank you so much. Just created an account to thank you.
Matt J
Matt J 2022년 11월 9일
You are quite welcome. Please Accept-click the answer if it was useful to you.

댓글을 달려면 로그인하십시오.


Tadios
Tadios 2024년 2월 7일
clc
clear
% close
snr = 20:5:60;
datanum = 10000;
M = 4;
K = [4, 10];
invber = zeros(2,length(snr));
reginvber = zeros(2,length(snr));
for ind1 = 1:1:length(snr)
disp(['Signal to noise ratio: ' num2str(snr(ind1)) ' dB'])
invtransmission
ber = invtransmission(snr, K, datanum);
invber4 = invtransmission(snr(ind1),K(1),datanum);
reginvber4 = reginvtransmission(snr(ind1),K(1),datanum);
invber10 = invtransmission(snr(ind1),K(2),datanum);
reginvber10 = reginvtransmission(snr(ind1),K(2),datanum);
invber(:,ind1) = [invber4; reginvber4];
reginvber(:,ind1) = [invber10; reginvber10];
end
Signal to noise ratio: 20 dB
Unrecognized function or variable 'invtransmission'.
invber;
reginvber;
figure
semilogy(snr,invber(1,:),'r--x','linewidth',1.5)
hold on
semilogy(snr,invber(2,:),'r-d','linewidth',1.5)
semilogy(snr,reginvber(1,:),'b-+','linewidth',1.5)
semilogy(snr,reginvber(2,:),'b-*','linewidth',1.5)
xlabel('rho (dB)');ylabel('BER')
legend('4x4 Channal Inversion','4x4 Regularized Channal Inversion',...
'10x10 Channal Inversion','10x10 Regularized Channal Inversion')
how to fix the problem " invtransmission4 = invtransmission(snr(ind1),K(1),datanum)"
  댓글 수: 2
Walter Roberson
Walter Roberson 2024년 2월 7일
The line you indicated as having a problem, does not appear in the code posted.
Functions invtransmission and reginvtransmission are not defined.
Matt J
Matt J 2024년 2월 7일
@Tadios You've posted as an answer that doesn't appear to address the OP's question, or to be related to it in any way. I will delete it soon, but invite you to repost as a separate question.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by