Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To pop to three vectors in Matlab by using Java's Stack

Tags:

java

matlab

I have a function

data1 = conv(data(75:138),hamming(64)); [B,T,F] = tfrwv(data1, 1:length(data1), length(data1));

I cannot push to three the stacks [B,T,F] so it is better to make one stack instead

BTF = java.util.Stack();

and now run

data1 = conv(data(1:64),hamming(64)); BTF.push(tfrwv(data1, 1:length(data1), length(data1)));

and now is the problem of popping the data from BTF into vectors B, T and F. I run unsuccessfully

[B,T,F] = BTF.pop();

The command BTF.pop() returns 127x127 double. So I need to handle the stack by some other function or start from scratch, probably from three stacks.

How can you pop from one stack the data of three variables into three vectors?

like image 900
Léo Léopold Hertz 준영 Avatar asked Nov 17 '25 22:11

Léo Léopold Hertz 준영


2 Answers

The problem of your code is, that BTF.push(tfrwv(...)); pushes the first output argument only. Use [B,T,F]=tfrwv(...);BTF.push({B,T,F}); instead.

like image 102
Daniel Avatar answered Nov 19 '25 12:11

Daniel


Use BTF.push({B,T,F}) instead, to deliver all the arguments

like image 36
lennon310 Avatar answered Nov 19 '25 11:11

lennon310