I'm using Kilosort for NeuroNexus 32 channel linear probes, and I'm getting this error during pre-processing: Error using matlab.internal.math.interp1 Error in interp1 (line 188) Error in shift_batch_on_disk2 (line 14) Error in datashift2 (line 149) Error in ksGUI/runPreproc (line 732) Error in ksGUI>@(,)obj.runPreproc() (line 333) Error while evaluating UIControl Callback. When I work around this error, I get another error during spike sorting: Error using gpuArray/subsref Error in extractTemplatesfromSnippets (line 56) Error in extract_spikes (line 42) Error in ksGUI/runSpikesort (line 795) Error in ksGUI>@(,)obj.runSpikesort() (line 339) Error while evaluating UIControl Callback. You can remove duplicates (the first value is kept) with
and interpolate with
I prefer This code will also sort your data points by time. I am using MATLAB to process and evaluate reflection coefficients of antennas. The data is saved and used as an Mx2 array, where the M is the length of the x-axis data points, (or sample points). The first coloumn contains the values of the frequency points and the second coloumn contains the corresponding reflection coefficient values. I use the 'interp1' function, which worked for the arrays of length 501, but the other array sized, 402, 404, 408 and 505, the following error occurs: Error using matlab.internal.math.interp1 Sample points must be unique and sorted in ascending order. Error in interp1 (line 188) VqLite = matlab.internal.math.interp1(X,V,method,method,Xqcol); I checked, and my sample points are unique and in ascending order, but the error still persists. Here is a little snippet of the data Sample point Reflection coefficient value 200 0.979472485068518 204.500000000000 0.977219575869647 209 0.974701356449019 213.500000000000 0.971883119143293 218 0.968724759813479 222.500000000000 0.965179866285502 227 0.961194345460292 231.500000000000 0.956704944454534 236 0.951637259422883 240.500000000000 0.945903325003744 245 0.939398658119580 Any and all help will be greatly appreciated. Hello! I have a file with information (image 1). In matlab, I chose that file, read it and save the different columns as I want (image 2). On data(:,1) which is my Phi angle I have values 0:5:360 and on data(:,2) which is my Theta angle I have values 0:5:180. In the file it looks like this: 0 0 0 5 0 10 0 15 ... ... 0 180 5 0 5 5 5 10 ... ... 5 180 ... ... 360 0 360 5 ... ... 360 180 So each combination of Phi and Theta have different values of E_phi and E_theta, which are the other columns. My goal now is to do an interpolation to have, for example, the values of E_phi and E_theta for Phi = 0.6 and Theta = 1.2. For that I created the new arrays of Phi and Theta, called Phi_new and Theta_new, respectly. (You can see the code and results in images 3 and 4. I think it is correct, it is just for you to understand better). So now I was doind this: >> E_phi_new = interp1(Phi, E_phi, Phi_new, 'spline'); >> E_theta_new = interp1(Theta, E_theta, Theta_new, 'spline'); I discover that this is not possible because "Error using matlab.internal.math.interp1. Sample points must be unique." which makes sense. To do this I think I need both the variable Phi and Theta and not just one in each line. But I don't understand how to do it. Have you got any suggestion? I am sorry for this big text, it is just to try to explain better my problem. In image 5 is the entire code, if it helps. Thank you very much! Answers (0)See AlsoCategoriesCommunity Treasure HuntFind the treasures in MATLAB Central and discover how the community can help you! Start Hunting! An Error Occurred Unable to complete the action because of changes made to the page. Reload the page to see its updated state. |