When using the 1D convolution example code from MATLAB am getting an error about incorrect use of '='.

2 ビュー (過去 30 日間)
When using the Sequence-to-Sequence Classification Using 1-D Convolutions example code the line "saying layer = sequenceInputLayer(numFeatures,Normalization="rescale-symmetric",Name="input"); "
On Matlab online it works as intended but on my pc running MATLAB 2020b I get the error saying Incorrect use of '='. To assign a value to a variable, use '='. To compare values for equality, use '=='.
Not sure what could be wrong would apriciate any assistance.

採用された回答

Steven Lord
Steven Lord 2021 年 12 月 16 日
The "Name=Value" syntax you're using was introduced in release R2021a. Your desktop MATLAB is too old to use that syntax, but MATLAB Online uses the most recent release (currently release R2021b) and so you can use this functionality there.

その他の回答 (1 件)

Christopher McCausland
Christopher McCausland 2021 年 12 月 16 日
Hi Joseph,
If you have a look at the docuementation it calls for named pairs for input, this would look something more along the lines of;
saying layer = sequenceInputLayer(numFeatures,Normalization,'rescale-symmetric',Name, 'input');
Give this a go and let me know how it goes. Usually "=" are only used to change a variable value and not in functional inputs unless you are evaluating a condition with "==" which would more be used for the likes of a loop.
Kind regards,
Christopher

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by