Remove Matlab r2014b Plot Browser limit - matlab

Among many distressing graphics changes to r2014b, the Plot Browser now only displays a certain number of lines per plot (looks like the limit is 50). Any number of plots above this limit are not displayed in the Plot Browser - it just says "and 78 more..."
Is there anyway to remove the limit? I want to see all my lines in the plot browser.

Unfortunately the answer is currenty:
No you cannot remove this limit
This was already reported to mathworks a while ago, and here is the reply:
I am writing in reference to your Technical Support Case #01143663
regarding 'plot browser with "and xxxx more...." indication'.
Really interesting question (and even a bit surprising). Basically
this limitation has been introduced with MATLAB 2014b!
Our developers are aware of that, and they are working to solve it. An
enhancement/bug request has been already submitted, and I am going to
add this case to the list. However, I cannot guarantee you a release
date.
If you think this limitation is crucial for your work, I would
strongly suggest you to contact your account manager, which will have
a bit more influence on the developers than a simple engineer :).
Of course, if there is anything else I can do for you, please let me
know
So it seems that you will have to deal with this limitation if you keep using 2014b.

This was also an issue for me; in particular I wanted to see the DisplayName property of the graphics object in the list. I used a workaround where I created a callback function, so that when clicking on a data point, the DisplayName would be shown. This can be helpful if you have a plot of many lines and want to see the DisplayName of a particular one. You would first need to set the DisplayName property of the graphics objects for this to work, as it's empty by default. You could also use this to show other properties, such as Color or LineStyle, that are shown in the plot browser:
%Based on
%http://www.mathworks.com/help/matlab/ref/datacursormode.html
%'fig_h' is the figure handle
dcm_obj = datacursormode(fig_h);
set(dcm_obj,'UpdateFcn',#myupdatefcn)
And then include this function as a separate file on the Matlab path, or paste into the function you're currently writing, and include an extra 'end' at the end of that function:
function name = myupdatefcn(empt,event_obj)
% Customizes text of data tips
tar = get(event_obj,'Target');
name = get(tar,'DisplayName');
end

Related

Cimplicity Screen - one object/button that is dependent on hundreds of points

So I have created a huge screen that essentially just shows the robot status for every robot in this factory (individually)… At the very end of the project, they decided they want one object on the screen that blinks if any of the 300 robots fault. I am trying to think of a way to make this work. Maybe a global script of some kind? Problem is, I do not do much scripting in Cimplicity, so any help is appreciated.
All the points that are currently used on this screen (to indicate a fault) have very similar names… as in, the beginning is the same… so I was thinking of a script that could maybe recognize if a bit is high based on PART of it's string name characteristic. The end will change a little each time, but I am sure there is a way to only look for part of a string and negate the rest. If the end has to be hard coded, that's fine.
You can use a Python script in Cimplicity.
I will not go into detail on the use of python in Cimplicity, which is well described in the documentation indicated above.
Here's an example of what can be done... note that I don't have a way to test it and, of course, this will work if the name of your robots in the declaration follows the format Robot_1, Robot_2, Robot_3 ... Robot_10 ... Robot_300 and it also depends on the Name and the Type of the fault variable... as you didn't define it, I imagine it can be an integer, with ZERO indicating no error. But if you use something other than that, you can easily change it.
import cimplicity
(...)
OneRobotWithFault = False
# Here you get the values and check for fault
for i in range(0, 300):
pointName = f'MyFactory.Robot_{i}.FaultCode'
robotFaultCode = cimplicity.point_get(pointName)
if robotFaultCode > 0:
OneRobotWithFault = True
break
# Set the status to the variable "WeHaveRobotWithFault"
cimplicity.point_set("WeHaveRobotWithFault", OneRobotWithFault)

How can I make this Max MSP/M4L patch update zl.len and zl.mth for an empty list?

Background
I'm trying to build a Max for Live device as a solution to the problem presented in this related question. As part of my solution I need to keep track of a group of notes (i.e. the selected, or in-scale notes).
My patch (see below) works great for any combination of held notes, but fails once the last note is released. When that happens, zl.len stays stuck at 1 and zl.mth continues to output whatever note was released last.
The question
How can I update my patch so that the length is 0 and the selected note is empty when the input list of held notes is empty?
What I have tried
I have tried banging the left inlet of the various zl objects manually and as part of the kslider update but this only produces the same unwanted behavior.
Here is a screen-shot of the patch:
and here is the corresponding code:
----------begin_max5_patcher----------
917.3ocyX0zbaCBD8ryL4+.iN6jAPHaodr8P+AzicxjQePrIUB4AgRcal9eu
7gUrSprJJF5zKlQqA18s6agmzyWe0hnh18ztHvG.eErXwyJKKL1zVVLXXQTS
99x57NyDi38METQzxC+m5QFulJM+I5Dqs8xAy3AypoxZ5az1fKOt4C1Pur9c
4h7FpjJtmxyKpouZE1cV9icTajGEsDDUjy2DAtaXNrJSv1V73MIwQG2VY4VF
ey8BZoztXbRxsvk.BYkdHNV+KFeKDbmYM+55qzipgkNmgJaaZnb4KdUR2abV
zmZ64RfbKErkVWA3sRUxeXV0LNsTOgWkwbI8BGCz3o.8ZnArYFLmhLOPtHLW
zKks7YwJdmE6IJzvovLxVniIolRLY32PTn+nJFM0YcIFnfPzkVOIYSgsXnkD
mYpqnDy.FFFv8EpDv3Uz8f1G.UzNlfVA5Jyqo2ng6kC0zI6WyHmzuhxPAEps
BosMUgXPdWIkWoBGPqnZlGANJPWOMPOzWlY.55rPBzOKZ628lSlTPV1BxA0r
NOveSlj+d3zWHxVTiCM+cn2zTW0OX3uWNJm7pFBw1dptdIwWco+Obta7j20f
WYNvkj5uyc4zuq76eVY+Y8scpN1wyF3+h1jQUULNfwS23FSN4hFBxCJJNGfk
B1lMTAn38Q.lQMFSlDxqSsMtlCoRhCHj2ITGKA5n0JmSqt3NVLxgRYhkBmBC
HtTb2F41fScQYtfW6PPot153F88NWbQDs1AwQGT6tZUXKhSfHeVFW4P6XLzP
XSBeYrlx2bNx6bpiwNHfmfMfy1RFt5nBRguJ5zKrX4swq8.d+VWM6TkqsO7P
G03tUv2EXmmDBlVNlc3X9nosh9JdhPcIj0BdjbV5z5HMoLDz9hsjgaiB.EoH
eyr3GnIyJiSOb.pXqlRblVR4nrC6Va97Bu8K8X1V8e7lDPWaunbH7F9DJ.3w
fT8VeRFOWxTROONK8cK.zT4ZmcnVgkiN7jYYesLcx1CgfVUq6gfGb3aQy3NT
KXwSNzwjL7LIYrGBgD3bBAefYhSI40ADyNl1OWH.+mkEzhLBV6kigP.SBoNw
DHALGfbi8G6uiXVMG1uOb3b3YdplhbgTg7l67FG9vE04618DUzcXOr9VII4w
VyhRWZelwsOakUDInOwFVRh0TtPIYPpzKzKLgbz9UGdGdijKAumMvi0nW6Zi
pGtRPW2tbKNMpit9J0D9MXvABqM
-----------end_max5_patcher-----------
Indeed the only way to know if there is nothing in a zl group object is to somehow keep track of whether something came in.
Here is an example that should do what you are looking for if I understand correctly:
----------begin_max5_patcher----------
1066.3ocwY1rbaaCDG+rzSAFdVQC9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3M5rWUcvJYoHWVpZC77bzsEftl1yUCM9Rtokz2ol
erD0EKQ7gkHumk7.RLG7cDOYGxBXG8Ew79xNenEbww4kHTzBQDYwbcIt3690
Ui4xJzUCmjoScTFN072Hmxqx7fkXNU8KxGBQWpIoa6b5VxEuGyG6cvntFmlr
kHtTQ2G6cvHtvT7hkHmYOQlr.lNwtowSqNYlK0I8wlYiAoaaoDeXIWR3dKRl
lDyOd7671tgYC1P0D72Z.ec5l0l++RlGg1VCZ4eubb9lIj2p5SUpZRsuEVWA
mhMWYDzOdqnubPynnSYRnAag5XDcGyMf.8gu9mq+eNu4kL.
-----------end_max5_patcher-----------
With the help of the Cycling74 forum, I came up with this solution that uses borax to count the held notes, and as a trigger to clear the zl object when the count is 0.
----------begin_max5_patcher----------
866.3ocuX1zaaBCFG+bxmBKzNlEgMP.lTOsO.6vNNMUYHtItCLHioKqU869r
eLrzlBIPBrKfvA3u+87N4kkKbRJNvpbPeA8CzhEurbwBXIyBKZtdgSN8PZFs
BtMmzh7blP4rx9aJ1AEr92j6nB9yLjZOCIJTrJDWnJPTTUgTw1hx3U+6ox3B
VZQs.dTulEE04E0pLlBDxsY0RpJcOWr6dIKUY2nDb7Z2UHOhm4TD1bzObsK5
mMOCeKrkJRd7ydwNGe8bQ6aGaV60kKMGVcij+0LFUBXq29k0JD+AsAnwFPkL
zdV11NI2erj6ERLvRb8MmBgiab6g7vYm7uyxzas24wgKpRoYrNIlLZhcAmre
75fUHbfK3385g3fIiXA62523G.VgdNK03tc5jC7YhYii.O2Ff.KGDxa3v9ZT
+ojYe.mVk5hTRzbSpNF9SbL5t6PtFWp.gGg+b.1AaD7F3BufyYG5z.fcmaCP
Rgjdna2b7YvyEHB6A3gsAum2OyMIVW4oNiM5zx3cMVl57DVOg5jyjxFrA7pg
gsIqmXBzhvyqyAGFtW2tFwDpXWmLF347O8kzblhIumInIYr2VNQieqNtSUzR
RsRUHFc5umIFWaL7gSD+1i8GVzK6djgv9bkV7b1ZS+7QGTfC7so5PCLe7kyK
LA.cGf2ciMxTVlOYzd3F.aJrQHWFvd8vD+4t3VoTW8.UAsuYacF8.X1h39a.
2XzGal8VXvNyeHYtZ+niHagfDdyQj334NhTy3NYQc4Um2YmUN3lnbyjQ4upx
3auhVK3X6j+vzfQ.YAdCr45w1OEaYuMYVpyCsKP9HzQCoXawCOTwT8V9cBiC
Rn6F+nmVyUynmD6EWbjjNi.tX..7TvHhm7Qkv9xr96YtpnVl1JaapD53VaKq
RwETEW2y83MYpoXtoNsqCVoMCQovoPoAHT6t4lDJZHDMQ5fGfN3aTGy6v6RF
tIfGiN9CPmofGxkzw8cNwBooNooxxsor+HhAOUZ7rC8IauoR4AA8rXtCGhxw
SQsE2gjyGMEIIQ+uXx70cCSoaMgzibcLYayQKKehIqZtaPDcS7GKf.nnUKse
Bp8Rn+rij8Du89g+1SGpT2tVo6UWKgMlygM1o+gwTjhZdSdfFOsjv.BB8fHU
kTKIvbDKec4eADs2DjA
-----------end_max5_patcher-----------

Mozilla Deep Speech SST suddenly can't spell

I am using deep speech for speech to text. Up to 0.8.1, when I ran transcriptions like:
byte_encoding = subprocess.check_output(
"deepspeech --model deepspeech-0.8.1-models.pbmm --scorer deepspeech-0.8.1-models.scorer --audio audio/2830-3980-0043.wav", shell=True)
transcription = byte_encoding.decode("utf-8").rstrip("\n")
I would get back results that were pretty good. But since 0.8.2, where the scorer argument was removed, my results are just rife with misspellings that make me think I am now getting a character level model where I used to get a word-level model. The errors are in a direction that looks like the model isn't correctly specified somehow.
Now I when I call:
byte_encoding = subprocess.check_output(
['deepspeech', '--model', 'deepspeech-0.8.2-models.pbmm', '--audio', myfile])
transcription = byte_encoding.decode("utf-8").rstrip("\n")
I now see errors like
endless -> "endules"
service -> "servic"
legacy -> "legaci"
earning -> "erting"
before -> "befir"
I'm not 100% that it is related to removing the scorer from the API, but it is one thing I see changing between releases, and the documentation suggested accuracy improvements in particular.
Short: The scorer matches letter output from the audio to actual words. You shouldn't leave it out.
Long: If you leave out the scorer argument, you won't be able to detect real world sentences as it matches the output from the acoustic model to words and word combinations present in the textual language model that is part of the scorer. And bear in mind that each scorer has specific lm_alpha and lm_beta values that make the search even more accurate.
The 0.8.2 version should be able to take the scorer argument. Otherwise update to 0.9.0, which has it as well. Maybe your environment is changed in a way. I would start in a new dir and venv.
Assuming you are using Python, you could add this to your code:
ds.enableExternalScorer(args.scorer)
ds.setScorerAlphaBeta(args.lm_alpha, args.lm_beta)
And check the example script.

Change figure name in every loop Matlab

I'm a beginner in Matlab but I must use it for my master thesis...
I must change the name of my figure and the name of the file I'll save for every loop I've tried that using the function "eval" as in the figure name is supposed to be written, as "Figure - Date which will change at each loops" but the way I used it is wrong. What could another function do this work? Or how do I have to change the setting of eval?
NAME={'Sept-Oct 2015','Nov 2015','Jan-Fe 2016','Fev 2016','Mars-Av 2016','Av-Mai 2016','Juin 2016','Juil 2016','Août 2016','Sept 2016','Oct 2016','Nov 2016','Déc 2016'};
for k=1:13
plot(time,data,'g');
eval(title('Figure -' NAME{1,k},'fontsize';14))
axis tight
eval(saveas(gcf,'Figure -' NAME{1,k},'eps'))
end
Thank you very much for the help.
Here is a fixed version of your code, with minimal change, if I got your intention correctly.
NAME={'Sept-Oct 2015','Nov 2015','Jan-Fe 2016','Fev 2016','Mars-Av 2016','Av-Mai 2016','Juin 2016','Juil 2016','Août 2016','Sept 2016','Oct 2016','Nov 2016','Déc 2016'};
for k = 1:13
plot(time,data,'g');
title(['Figure -' NAME{1,k}],'fontsize',14)
axis tight
saveas(gcf,['Figure -' NAME{1,k}],'eps')
end
However, right now you plot 13 times the same figure (with a different title), so I guess data and time should be indexed somehow. Also keep in mind that this changes the title of the figure (which is printed in it), not it's name (which appears at the top of the window/tab).

Debugging a for loop in matlab

I've been looking throught the documentation, but can't seem to find the bit I want.
I have a for loop and I would like to be able to view every value in the for loop.
for example here is a part of my code:
for d = 1 : nb
%for loop performs blade by blade averaging and produces a column vector
for cc = navg : length(atbmat);
atb2 = (sum(atbmat((cc-(navg-1):cc),d)))/navg;
atbvec2(:,cc) = atb2;
end
%assigns column vector 'atbvec2' to the correct column of the matrix 'atbmat2'
atbmat2(d,1:length(atbvec2)) = atbvec2;
end
I would like to view every value of atb2. I'm a python user(new to MATLAB) and would normally use a simple print statement to find this.
I'm sure there is a way to do it, but I can't quite find how.
Thankyou in advance.
you can use disp in Matlab to print to the screen but you might want to use sprintf first to format it nicely. However for debugging you're better off using a break point and then inspect the variable in the workspace browser graphically. To me, this is one of Matlab's best features.
Have a look at the "Examine Values" section of this article
The simplest way to view it everywhere is to change this line:
atb2 = (sum(atbmat((cc-(navg-1):cc),d)))/navg;
Into this, without semicolon:
atb2 = (sum(atbmat((cc-(navg-1):cc),d)))/navg
That being said, given the nature of your calculation, you could get the information you need as well by simply storing every value of abt2 and observing them afterwards. This may be done in atbmat2 already?
If you want to look at each value at the time it happens, consider setting a breakpoint or conditional breakpoint after the line where abt2 is assigned.