필터 지우기
필터 지우기

Perform inverse of each double within a cell

조회 수: 4 (최근 30일)
gd
gd 2020년 3월 18일
댓글: gd 2020년 3월 18일
Hi all,
Just want to preface saying I'm a newbie with Matlab so thank you for your help and patience.
I've got a 10x1 cell titled "Period," where each row contains a double ranging from 771x224 to 771x240 (see screenshot below). I want to find the inverse of each Period value (1/Period value) in each double, for the entire Period cell, and place into a new 10x1 cell titled "Frequency". To my understanding, I cannot use cellfun to perform this.
Thank you in advance, I appreciate any help / tips!

채택된 답변

the cyclist
the cyclist 2020년 3월 18일
Why do you think you cannot use cellfun?
Period = {[2 3; 5 7],[11 13]};
Frequency = cellfun(@(x)1./x,Period,'UniformOutput',false);
  댓글 수: 1
gd
gd 2020년 3월 18일
Thank you for your help. I was getting lost in the documentation for cellfun and didn't realize I could define my own function. This is helpful and I appreciate your quick response! I aim to decode documentation more thoroughly as I continue my Matlab practice.
Have a nice day and stay well!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by