<｜begin▁of▁sentence｜>### Instruction:
Given a graph G with nodes and edges specified, can you use networkx to find out the number of rows in the adjacency matrix, which corresponds to the number of nodes in the graph, and save that information into a JSON file?
### Response:
import networkx as nx
import json

# Create a graph with nodes and edges
G = nx.Graph()
G.add_edges_from([(1, 2), (1, 3), (3, 4), (2, 4)])

# Get the adjacency matrix (as a numpy matrix)
adj_matrix = nx.to_numpy_matrix(G)

# Print the number of rows which corresponds to the number of nodes
print('Number of rows (nodes):', len(adj_matrix))

# Saving output to JSON
output = {'Number of rows (nodes)': int(len(adj_matrix))}
with open('matrix_info.json', 'w') as f:
  json.dump(output, f)
<|EOT|>
