
184 Cal.App.3d 577 (1986)
229 Cal. Rptr. 215
THE PEOPLE, Plaintiff and Respondent,
v.
ROBERT DEAN STANFILL, Defendant and Appellant.
Docket No. F005355.
Court of Appeals of California, Fifth District.
August 18, 1986.
*578 COUNSEL
Janice M. Lagerlof, under appointment by the Court of Appeal, for Defendant and Appellant.
John K. Van de Kamp, Attorney General, James T. McNally and Edgar A. Kerry, Deputy Attorneys General, for Plaintiff and Respondent.
[Opinion certified for partial publication.[*]]
OPINION
FRANSON, Acting P.J. 

STATEMENT OF THE CASE
Appellant was convicted by a jury of a felony violation of Penal Code section 12021 (ex-felon in possession of a concealable weapon) and two misdemeanor violations, Vehicle Code section 10852 (tampering with a vehicle) and Penal Code section 594 (vandalism).
On August 7, 1984, appellant's jury trial began, but at the request of defense counsel a mistrial was declared. Proceedings were suspended so that appellant could be examined pursuant to Penal Code section 1368 to determine whether he was competent to stand trial.
*579 On September 12, 1984, after submission of the matter on the two doctor's reports, appellant was found to be competent for trial, criminal proceedings were reinstated, and jury trial was set for October 29, 1984.
On the first day of trial, defense counsel moved for a continuance to secure the attendance of the psychiatrist who had examined appellant after the earlier mistrial. This motion was denied, and trial continued through October 31, 1984, at which time appellant twice moved for a mistrial and renewed his motion for a continuance. These motions were denied, and appellant was convicted on all counts.
Appellant was sentenced to state prison for the middle term of two years on the Penal Code section 12021 violation and to time served on the two misdemeanor offenses. He was also ordered to pay a $300 restitution fund fine.

STATEMENT OF THE FACTS
On April 18, 1984, appellant was observed at the Par 3 golf course in Modesto engaging in unusual behavior. Appellant crouched behind bushes and pointed a handgun held at arms' length in various directions on the golf course. Next, appellant entered an unlocked van, hopped around inside, moved around some boxes of tools, got out and fired a shot.
Appellant then went to the pro shop and walked through a locked sliding glass door leaving an almost perfect silhouette of a man through it. Inside the pro shop, appellant went to the men's room where one of the witnesses had locked himself in and was pushing against the door. Appellant split the door sash but did not get into the men's room.
When the first two law enforcement officers arrived and spoke to appellant, he brought out a knife and moved it up and down a few times. After the officers drew their guns, appellant put down the knife and was apprehended.
Appellant had a blank stare, seemed listless, and did not respond to the officers' questioning. When asked his name, address, and date of birth, appellant replied with slurred, slow speech: "I do not have a name"; "I do not live anywhere"; and "I have not been born yet." On the basis of appellant's demeanor, slow movements and behavior, one of the arresting officers requested a mental health evaluation of appellant. This arresting officer did not detect the odor of alcohol on appellant's breath.
Approximately seven and one-half months before this golf course incident, appellant had a confrontation with the police and was hit on the head with *580 a police baton. Kathryn Fisher, who had lived with appellant for six years, testified that since that time appellant's behavior had been different in that he slept a lot, his moods had changed, and he blacked out frequently. Appellant has a civil action for damages pending against the officer who hit him and against the city.
Appellant testified he did not remember any of the events on the Par 3 golf course. He remembered driving to Scenic General Hospital on the morning of April 18 and leaving there. The next thing he remembered was waking up handcuffed to a gurney. Appellant testified he did not remember driving to a golf course, having a pistol in his possession, walking through a glass door, having a knife, or being confronted by police officers.
Dr. Robert Miller, a psychiatrist appointed to examine appellant pursuant to Penal Code section 1368, was called as a rebuttal witness by the prosecution over defense objection. Based on his examination of appellant, Dr. Miller testified that he was of the opinion that appellant was aware of what he was doing on April 18.
Appellant's defense was that, due to medication he was taking, he was unconscious during the entire incident at the golf course and thus, incapable of possessing the intent necessary to commit the charged offenses.

DISCUSSION

I.

Was it error to admit the testimony of a psychiatrist who had examined appellant with regard to his mental competence during earlier proceedings?
In Tarantino v. Superior Court (1975) 48 Cal. App.3d 465 [122 Cal. Rptr. 61], the court considered the question whether compelling a defendant to submit to an examination by court-appointed psychiatrists violated the defendant's right against self-incrimination. The court concluded such an examination did not violate that right because of a judicially declared immunity reasonably to be implied from the code provisions. To protect a defendant's privilege against self-incrimination, the court declared "that neither the statements of [a defendant] to the psychiatrists appointed under section 1369 nor the fruits of such statements may be used in trial of the issue of ... guilt, under either the plea of not guilty or that of not guilty by reason of insanity." (Id., at p. 470.)
In People v. Arcega (1982) 32 Cal.3d 504 [186 Cal. Rptr. 94], the California Supreme Court approved the holding of Tarantino v. Superior Court. *581 The court rejected the contention that the admissibility of statements made during a Penal Code section 1368 examination was based on the statutory privilege accorded confidential psychotherapist-patient communications (see generally Evid. Code, §§ 1010-1015) and approved the rationale for excluding such statements based on the privilege against self-incrimination.
The United States Supreme Court also applied the privilege against self-incrimination to a custodial mental competency examination in Estelle v. Smith (1981) 451 U.S. 454 [68 L.Ed.2d 359, 101 S.Ct. 1866]. There, the court ruled that a defendant's Fifth Amendment rights were violated when the state introduced evidence of statements the defendant made at a custodial mental competency examination at the penalty phase of a capital case where the defendant was not informed of, and did not waive his Miranda[1] rights prior to the examination. However, the court noted that a different situation arises where the defendant intends to introduce psychiatric evidence in his favor at the penalty phase.
(1) Based on the above authorities, appellant contends that any statements he made during the mental competency examination conducted pursuant to Penal Code section 1368 were absolutely privileged and therefore it was error to admit the testimony of Dr. Miller, one of the psychiatrists appointed to examine appellant.
Since the reason for excluding statements made by a defendant during a mental competency examination is to protect the defendant's privilege against self-incrimination, the law governing that privilege should be applicable. Thus, appellant's argument that any statements made during a mental competency examination are absolutely privileged is valid only if the privilege against self-incrimination is an absolute privilege. However, the privilege against self-incrimination can be waived and therefore is not absolute.
A defendant who takes the stand to testify in his own behalf waives the privilege against self-incrimination to the extent of all inquiries which would be proper on cross-examination and is subject to impeachment the same as any other witness. (People v. Saddler (1979) 24 Cal.3d 671, 679 [156 Cal. Rptr. 871, 597 P.2d 130]; People v. Thomas (1974) 43 Cal. App.3d 862 [118 Cal. Rptr. 226].) Thus, the defendant waives the privilege with respect to any matter to which he testified expressly or impliedly on direct examination and that is relevant to impeach his credibility as a witness. (People v. James (1976) 56 Cal. App.3d 876, 887-888 [128 Cal. Rptr. 733].)
The crucial distinction between this case and the above cited authorities relied on by appellant is that here, appellant chose to testify. Appellant *582 testified that he had no recollection of the golf course incident. By so testifying, appellant opened the door to cross-examination regarding his recollection of these events and to impeachment of his credibility. The substance of Dr. Miller's testimony was his conclusion, based on his examination of appellant, that at the time of the alleged offense, appellant was aware of his surroundings and actions. Apparently, during this examination, appellant and Dr. Miller discussed the events which took place at the golf course. However, Dr. Miller did not repeat any specific statements made by appellant during the Penal Code section 1368 examination.
Dr. Miller's testimony was directly related to appellant's express testimony that he had no recollection of the events at the golf course. Therefore, Dr. Miller's testimony was relevant to impeach appellant's credibility. Since appellant testified regarding his memory of the golf course incident on direct examination, he waived his privilege against self-incrimination with respect to his discussions regarding this incident with Dr. Miller. Thus, it was not error to admit Dr. Miller's testimony.

II., III.[*]
.... .... .... .... .... .... .
The judgment is affirmed.
Ballantyne, J., and Papadakis (V.N.), J.,[] concurred.
NOTES
[*]   Pursuant to California Rules of Court, rules 976(b) and 976.1, this opinion is certified for publication with the exception of parts II-III.
[1]  Miranda v. Arizona (1966) 384 U.S. 436 [16 L.Ed.2d 694, 86 S.Ct. 1602].
[*]   See footnote, ante, page 577.
[]   Assigned by the Chairperson of the Judicial Council.
