stem fuction shows error everytime

1 visualización (últimos 30 días)
Ayush Bhagta
Ayush Bhagta el 25 de En. de 2020
Respondida: Walter Roberson el 25 de En. de 2020
Attempt to execute SCRIPT stem as a function:
C:\Users\Asus\Documents\MATLAB\stem.m
Error in new (line 10)
stem(t,fun1);
this error appears everytime i use stem.
This is what i wrote:
clc;
clear all;
close all;
t=0:0.1:5;
x=sin(2*pi*t);
y=cos(2*pi*t);
f1=subplot(3,2,1);
fun1=x+y;
stem(t,fun1);
grid on;
title('add');
xlabel('t');
ylabel('add');

Respuestas (2)

Star Strider
Star Strider el 25 de En. de 2020
You have a script file that you named ‘stem’. This is called ‘overhsadowing’ a MATLAB function.
The solution is to find the script file and re-name it.
Running:
which stem -all
will tell you where it is. It should be the first line in the returned list.

Walter Roberson
Walter Roberson el 25 de En. de 2020
The stem.m file that it lists in the error message: you need to rename it to something else. For example mystem.m

Categorías

Más información sobre Agriculture 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