Borrar filtros
Borrar filtros

error unrecognized function or variable help me please :(

5 visualizaciones (últimos 30 días)
Time
Time el 7 de Feb. de 2024
Respondida: Cris LaPierre el 7 de Feb. de 2024
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 .

Respuestas (1)

Cris LaPierre
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)
ans = -2.4493e-16
% error because y has not been defined
sin(y)
Unrecognized function or variable 'y'.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by