You can set a variable in the view file, but it will be printed just as you set it. Anyway, there is a workaround. You can set the variable inside an unused section. Example:
@section('someSection')
{{ $yourVar = 'Your value' }}
@endsection
Then {{ $yourVar }}
will print Your value
anywhere you want it to, but you don't get the output when you save the variable.
EDIT: naming the section is required otherwise an exception will be thrown.