error unrecognized function or variable help me please :(
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Cris LaPierre
el 7 de Feb. de 2024
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 comentarios
Ver también
Categorías
Más información sobre Environment and Settings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!