error unrecognized function or variable help me please :(
6 ビュー (過去 30 日間)
古いコメントを表示
function [] = PlotSignal(signalsCell,n)
signals=signalsCell{2*n-1};
plot(signals,'k')
end
Write a function called PlotSignal, the function will display on a graph the signal it receives.
function inputs:signalsCell – cell array object (each pair of rows in it represents one letter)
1.1.2 n – the number of the signal to be displayed
1.2. The function does not return any value.
1.3. The letter n from the array of cells should be displayed on a graph according to the following detail:
1.3.1. The signal color shall be black.
thats a part from the task i also got a load folder named "signals" to write this code .
but i always get a error about the signalcells
>> PlotSignal(signalsCell, n)
Unrecognized function or variable 'signalsCell'.
can anyone help me with that ? did i even wrote the code ok ? im not sure tho .
0 件のコメント
回答 (1 件)
Cris LaPierre
2024 年 2 月 7 日
You need to define your function inputs. You have no variable in your workspace names signalsCell. Define one before calling your function. Here's a simple example
x = 2*pi;
% works because x has been defined
sin(x)
% error because y has not been defined
sin(y)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!