# Close function Julia

**URL:** <https://discourse.julialang.org/t/close-function-julia/23081>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 12, 2019, 2:35pm UTC](https://discourse.julialang.org/t/close-function-julia/23081 "2019-04-12T14:35:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aquaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquaman/32/6586_2.png) [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Post date:** [April 12, 2019, 2:35pm UTC](https://discourse.julialang.org/t/close-function-julia/23081/1 "2019-04-12T14:35:01Z")

</div>

Hi everyone,

which command in Julia is equal to `close` **in Matlab**?

e.g.

```julia

if i==1
close
end

```

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [April 12, 2019, 2:45pm UTC](https://discourse.julialang.org/t/close-function-julia/23081/2 "2019-04-12T14:45:34Z")

</div>

I’m not quite sure if it’s equivalent, since I’m not quite sure what the matlab command actually _does_ (I’m not familiar with matlab, I just looked at the docs), but in Julia `exit()` closes the REPL, so perhaps that’s what you’re looking for?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [April 12, 2019, 3:09pm UTC](https://discourse.julialang.org/t/close-function-julia/23081/3 "2019-04-12T15:09:24Z")

</div>

This deletes the current figure in Matlab as far as I recall. I don’t think there is anything similar in Julia. I believe it depends where that figure (plot) was displayed: the terminal, Atom or VS code, or an Electron window, or a webpage. The actions would be very different. I think that is why that function doesn’t exist.

---

<div class="post-metadata">

**Author:** ![Aquaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquaman/32/6586_2.png) [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Post date:** [April 12, 2019, 3:11pm UTC](https://discourse.julialang.org/t/close-function-julia/23081/4 "2019-04-12T15:11:23Z")

</div>

Professor, Thanks very much for your detailed answer!

Kind regards.
