Change language to:
English - Français - Português - Русский

See the recommended documentation of this function

Scilab help >> Matlab to Scilab Conversion Tips > Matlab-Scilab equivalents > S > size (Matlab function)

# size (Matlab function)

Array dimension

### Matlab/Scilab equivalent

 Matlab Scilab `size` `size`

### Particular cases

Due to the fact that strings or not considered in the same way in Matlab and in Scilab, results are not equal for string matrices, convert it using m2scistr to have the same result.

d = size(X,dim)

If dim is greater than number of dimensions of X, Matlab returns d=1, but in Scilab, you get an error message. Scilab mtlb_size can work with dim greater than number of dimensions of X.

[d1,...dn] = size(X)

If n is greater than number of dimensions of X, all "extra" variables are set to 1 in Matlab but Scilab returns an error message. Scilab mtlb_size returns a Matlab like result in these cases. When n is less than number of dimensions of X, dn contains the product of the sizes of the remaining dimensions in Matlab but in Scilab dn = size(X,n), use mtlb_size for such uses.

 Report an issue << sinh (Matlab function) S sort (Matlab function) >>
{"ft_lang_label":"__label__en","ft_lang_prob":0.7917302,"math_prob":0.88333994,"size":1624,"snap":"2022-40-2023-06","text_gpt3_token_len":434,"char_repetition_ratio":0.30246913,"word_repetition_ratio":0.05147059,"special_character_ratio":0.24692118,"punctuation_ratio":0.08571429,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9998994,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-04T02:56:33Z\",\"WARC-Record-ID\":\"<urn:uuid:8d890d22-6990-4b54-9143-9d4e344b0fea>\",\"Content-Length\":\"9714\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b77c6292-9908-4ccc-93bb-14e391160784>\",\"WARC-Concurrent-To\":\"<urn:uuid:ee35725e-9524-4d1f-9399-281ce0ceb3e8>\",\"WARC-IP-Address\":\"107.154.79.223\",\"WARC-Target-URI\":\"https://help.scilab.org/docs/5.4.1/ja_JP/m2sci_size.html\",\"WARC-Payload-Digest\":\"sha1:CVFVYD3POZLQMMQXVRYUS2HUHYZPQTGQ\",\"WARC-Block-Digest\":\"sha1:HSD76AI5PGIOFE4BIGZ5WMSW6TDAUAKH\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500080.82_warc_CC-MAIN-20230204012622-20230204042622-00687.warc.gz\"}"}