How to create 3D sine array?

My question is simple. I want to create a sine function that is 1:1:1000 in size. Here is the code I have so far:
Fsam = 30; % Sampling Freq
Amp = 1;
Freq = 1;
Time = [0:1:1000-1];
Sig = Amp*sin(Freq*2*pi*Time); %Signal
This will create an array "Sig" that is size (1x1000). How do I extend this to a three dimensional 1x1x1000 array? Your help is greatly appreciated.

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 5 日
編集済み: Azzi Abdelmalek 2013 年 3 月 5 日

0 投票

reshape(Sig,1,1,numel(Sig))
Youssef  Khmou
Youssef Khmou 2013 年 3 月 5 日

0 投票

hi Sarah,
first the time axis is not properly sampled Fs=30; Time = [0:1/Fs:1000-1/Fs];
Can i ask you what is the purpose of adding Singleton dimension?

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2013 年 3 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by