Search

Unable to save path to file : matlab

When executing the command, savepath in matlab in linux if you encounter the error.



It is because the pathdef.m file does not have the permissions required. To verify this execute the command ls -l /usr/local/MATLAB/R2017a/toolbox/local/pathdef.m

We should see an output which displays the following permissions, only read permissions.



To workaround the error, execute the command



The error should not appear anymore when you run the command savepath.

Creating proc read write function in linux kernel 5.3

In the post "Creating proc read and write entry (linux kernel 4.6)" we saw the details of creating a proc entry in linux kernel version 4.6 .The following is the code to create a simple proc entry to which we can write as well as read from it works with the linux kernel 5.3.

The only change in this as compared to the previous post for version 4.6 is the use of function "simple_read_from_buffer" which copies data from buffer, which is memory in the kernel space to user space. It returns the size of the data of bytes of data to read. The return type of function written to read the proc content is changed to ssize_t from int. Thus making the above two changes the read_proc function now looks like this



We use the temp variable to keep track of how much data is being transferred to the user space. count holds the number of bytes of data written by the write function of the proc entry. For writing data to proc entry we use the function and simple_write_to_buffer which write a message from user space to memory buffer in kernel space which will hold the data in the proc entry.The function meant to write data to proc entry is meant to return the size_t, the size of data written to the proc entry.



Thus the full code for creating the proc entry is



Save the file as proc_rw_5_3.c .

The make file required to compile the above code is



Compile and test the module using the following steps.




Raspberry pi : Can not currently show the desktop

Raspberry pi can be connected to a laptop monitor using a network cable. The GUI can be accessed by use of real vnc server. It might pop the following error when connecting



This is generally because the resolution of raspberry is set wrong. To change the resolution and access it using VNC we can follow the steps given below.

Connect to pi using putty and launch the raspberry pi config using the command



Go to the advanced options




Then go to Resolution options



Choose the maximum resolution.




Click on ok and then finish . It will prompt for a reboot, select yes.Once pi reboots , VNC should be able to connect successfully.