How can I run a section when there are still errors present in other sections?
이전 댓글 표시
I provide my students with a script, which they need to modify. I want them to evaluate the part they have finished but the script will not run because of errors still present in other sections. with 2017a it is possible, with 2017b not.
Example code, the first section (with clear) will not execute because of errors in the code below that.
%% (c) C.M.G. van Leuken, W.L. van de Groep, R.G.P. Ritzen
% Fontys University of Applied Sciences, Mechanical Engineering
% (Fontys Hogeschool Engineering, opleiding Werktuigbouwkunde)
clear all close all clc
%% EXERCISE 3-1 (OPDRACHT 3-1)
% Write down the code to make plots of the V-line (equation 3-9) and M-line (equation 3.10) as a function
% of x.
% (Maak hieronder de plotjes van de D-lijn (vergelijking 3-9) en M-lijn (vergelijking 3-10) als
% functie van x.)
dx = ... % step size (stap grootte)
x1 = ... % first interval (eerste interval)
x2 = ... % second interval (tweede interval)
x3 = ... % third interval (derde interval)
x = [x1 x2 x3]; % combining the intervals (samenvoegen van de intervallen)
D1 = ...
D2 = ...
D3 = ...
D = ... % V-line (D-lijn)
M1 = ...
M2 = ...
M3 = ...
M = ... % M-line (M-lijn)
댓글 수: 2
madhan ravi
2018년 10월 9일
you can make them to test it in live editor
KSSV
2018년 10월 9일
Explore the option of run and advance
채택된 답변
추가 답변 (4개)
Adam Campos
2023년 6월 4일
편집: Adam Campos
2023년 6월 4일
1 개 추천
To clarify, my issue is with the Live Scripts - I'm not sure I understand what the point of 'Run Section' is if it picks up syntax errors in other sections and doesn't run the given section. I have hundreds of scripts with similar type of temporary filler for variables, I know and understand that there are syntax issues because it has temporary filler in the other sections, but this is pretty burdensome that I have to inspect the whole script fix all the errors just to get started. I fully expect an error if I chose 'Run', but not 'Run Section'
Jupyter Notebooks let you run a section and leave the rest for development, which is what I was expecting.
댓글 수: 2
Niklas
2024년 3월 13일
I have exactly the same problem and am seriously considering of rewriting everything in Python Jupyter Notebooks.
Adam Campos
2024년 3월 16일
If you have to transition them I did bulk find and replace in a text editor, like VS Code and converted them over....I know this doesn't solve your problem, but easier than trying to fix scripts directly within MATLAB.
Stephen Ofori
2023년 10월 18일
1 개 추천
Hi Kindly insert ‘Section break’ at the various sections you want to run separately. Go to Live Editor Tab > Section > Section Break
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!