Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I want to use Matlab for my project. matlab has tensor toolbox and in it there are two types of tensor : Dens tensor and sparse tensor. my project is about " fiber orientation". how can i know what type is my tensor and use which one from tensor toolbox in Matlab. thanks for your attention

share|cite|improve this question

1 Answer 1

up vote 0 down vote accepted

In general a sparse tensor is a tensor with many zeros whereas a dense tensor has no (or hardly any zeros.

So you could check for the number of non-zeros (nnz(A)) and compare that to the size of the tensor

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.