James K. Matter, 46, a Foreign Service officer in the State Department who specialized in economics and the Middle East, died of leukemia July 18 at George Washington Hospital.He lived in Vienna.

Mr. Matter was born in New Kensington, Pa., and grew up in Detroit. He moved to Washington following his graduation from Harvard in 1956 and worked briefly for the State Department. He then served two years in the Army.

In 1959, he resumed his career at State. His first foreign assignments were Hong Kong and Zurich. He then returned to Washington and studied economics at the Foreign Service Institute. He was assigned to the Israeli desk in the State Department and in 1970 was transferred to Israel.

In 1974, he returned to Washington and worked at the State Department and the Office of Management and Budget. In 1978, he went to Liberia, where he remained until the end of 1979, when he returned here for reasons of health. His last assignments were on the Liberian desk at State and working with then-ambassador Sol M. Linowitz, the special negotiator on Middle East questions in the Carter Administration.

Mr. Matter was a member of the Foreign Service Association.

Survivors include his wife, Kendrick Matter, and three daughters, Marguerite ye. Jennifer L. and Kristin L. Matter, all of Vienna; a sister, Martha M. Ely of Rockville, and a brother, Robert A. Matter of Battle Creek, Mich.

The family suggests that expressions of sympathy be in the form of contributions to the American Cancer Society of Northern Virginia, P.O. Box 699, Vienna, Va., 22180, or to the American Red Cross.