From 010e48ecafd5485270c475c7e4b93b1790af78b5 Mon Sep 17 00:00:00 2001
From: vand <vand@dtu.dk>
Date: Thu, 10 Jun 2021 19:33:29 +0000
Subject: [PATCH] Upload New File

---
 module3_wrapup.m | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 module3_wrapup.m

diff --git a/module3_wrapup.m b/module3_wrapup.m
new file mode 100644
index 0000000..efeb754
--- /dev/null
+++ b/module3_wrapup.m
@@ -0,0 +1,15 @@
+%% module 3, example - short-circuit operators
+
+name = 'Vedrana';
+%name = '';
+
+% I want to check if the name starts with 'Ved'. But what if name has less than
+% 3 letters? I need to make sure that name[:3] is not evaluated if name is too 
+% short. I add the first condition and &&. The second condition will not be
+% evaluated if the first is false.
+
+if numel(name)>3 && all(name(1:3)=='Ved')
+    disp('Cool')
+else
+    disp('Not so cool')
+end
\ No newline at end of file
-- 
GitLab