I think i broke my matlab. A few days ago I seamingly deleted matlabs appdata. (I know stupid).
So i Installed a new version(2021b) becasued i had 2021a. Since then my matlab doesnt work the way it did.
I tried to run this simple code
close all;
clear all;
R = 1;
L = 10e-6;
C = 11e-6;
t_fun = tf([1 0],[L*C*R, L, R]);
bode(t_fun);
title("Übertragungsfunktion");
wich works in matlab online but not on my PC giving me this error
Check for incorrect argument data type or missing argument in call to function 'tf'.
So I am guessing the error comes from this error that I get from starting matlab.
Warning: Executing startup failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should be resolved as soon as possible. Error detected was:
MATLAB:UndefinedFunction
Undefined function 'pm_addunit' for input arguments of type 'char'.
I dont really know what to do here. I deinstalled Matlab2021b and reinstalled it twice already the error wont change. I tried running other simple code on matlab i used to have that works. But i dont really want to be suprised when I use matlab and dont know if the error comes from my faulty code or my broken programm.

댓글 수: 1

Matt J
Matt J 2021년 11월 3일
Do you have a startup.m file? If so, what's in it?

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2021년 11월 3일

0 개 추천

Something in your matlabrc is invoking something that tries to use pm_addunit() from the Simscape Physical Modeling Toolbox, but you do not have that toolbox installed.
pm_addunit() adds a new physical unit, so possibly someone thought that was a good idea to have happen automatically for all sessions instead of each project having to initialize the unit.

댓글 수: 1

Oh okay, Thx i Installed the toolbox and the warning is gone.
But i still dont quite understand why the code that I made doesnt work offline but if i try it in matlab online editor it works.
Check for incorrect argument data type or missing argument in call to function 'tf'.
Error in abgabe6 (line 8)
t_fun = tf([1 0],[L*C*R, L, R],-1);
I dont get why it doesnt work if it works online but not here. It said i need a toolbox and I installed one but it still is not working.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by