How to Return two Matrix of dimension (T,N)
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Praveen Pawar
am 6 Mär. 2018
Beantwortet: Jos (10584)
am 6 Mär. 2018
Hello, please help me to store two different matrices like G and H as an output parameter of a 'function'.
For example, function[G, H]= input(T,N) so G and H both contain T*N matrix, Here T is iterations and N may be considered as the number of users. I can obtain G and H through some logic for one iteration. I want T = 100 different channel gains G and H for N number of users.
thanks in advance
0 Kommentare
Akzeptierte Antwort
Jos (10584)
am 6 Mär. 2018
function [G, H] = MyInput(T,N)
% do not name this function input, as this is already used by ML !!!
G = zeros(T,N) ; % pere-allocation to speed things up
H = zeros(T,N) ;
for Ti = 1:T,
for Ni = 1:Ni,
G(Ti,Ni) = ...
end
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!