Réponse apportée
Get the column number of the false values in a logical output
You can use the find function: N = 50; A = 1:N; B = 1:41; index = ismember(A,B); [row,col] = find(~index); disp(col)

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
I want MATLAB to trigger an event at 8:00 AM tomorrow, how would I do that?
You should use the timer class that Fangjun linked, but your approach is also possible: t2 = datetime('tomorrow'); while true ...

plus de 5 ans il y a | 0

Réponse apportée
Count Total Number of Rows for Multiple .txt files in a Folder
I don't think it is possible to avoid reading all files and count the number of lines in each (unless each line is a fixed lengt...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
GUI Push Button Help!
There are two strategies to do this. You can either put all buttons and other relevant objects in the same figure and set the vi...

plus de 5 ans il y a | 0

Réponse apportée
Finding the length of square function
In general you can approximate the arc length by measuring the distances between the points and adding them. t=linspace(0,20,10...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
matlab code for pseudo random
This looks like a fairly fragile setup to share an encryption key. Any file that results in a valid state value can be used. ...

plus de 5 ans il y a | 0

Réponse apportée
Convert a value into a Matlab syntax string
You can do it like that, but it is already Matlab syntax if you add the square brackets, as arrays can be defined across multipl...

plus de 5 ans il y a | 1

Réponse apportée
Sorting out data in a matrix
Loop through the elements of find(diff(A(:,3))>=5) That way you can get the row indices for the cases you need. That should m...

plus de 5 ans il y a | 0

Réponse apportée
For loops for multiple variables
You only need a single loop: for n = 1:length(C) m_=m(n); rho_=rho(n);

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to bookmark a piece of code
I believe it is possible to add buttons that run code. You can use the clipboard function to copy this as text to the clipboard....

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
How to select data points for interpolation
Index your variable: point(1:5)

plus de 5 ans il y a | 0

Réponse apportée
How to write multiple image from a for loop to a dir
Assuming the missing end keyword goes at the end: Your filename depends on only the inner loop, not the outer loop.

plus de 5 ans il y a | 0

Réponse apportée
Not enough input arguments despite all arguments available
Strange errors are bound to appear if you use the function name as a variable as well. This might result in a parse error on som...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Plotting Electrical Signals with Guide
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread. For general advice a...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Generate a Matrix with the structure in the description
No loops required: X=tril(ones(128)); [r,c]=find(X); out=[c r]; For the next step I would suggest you create a cell array wi...

plus de 5 ans il y a | 1

Réponse apportée
Need help graphing this
The <https://www.mathworks.com/support/learn-with-matlab-tutorials.html Onramp tutorial> will guide you through problems like th...

plus de 5 ans il y a | 0

Réponse apportée
How can i create constant in a .m archive and use it for the creation of new objects?
You could turn your script into a function. If you store all variables as fields of a struct you can use something like this to ...

plus de 5 ans il y a | 0

Réponse apportée
Best way to pass uicontrols/data to callback function.
I would suggest splitting everything into smaller functions. If you have a function that changes the content of buttons: write i...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
make plot the square wave
Since this is homework, I left some holes for you to fill. T=___;%what should the period of your square wave pulse be if you wa...

plus de 5 ans il y a | 0

Réponse apportée
How to extract specific data from file extension TRO file?
You could use something like readtable to load your file to a table. If that doesn't work you will have to process each line sep...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How can one get t-stat of fitlm as an output?
It is in the top example: load carsmall X = [Weight,Horsepower,Acceleration]; mdl = fitlm(X,MPG); mdl.Coefficients.tStat

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
A loop that saves the data from the inner loop as next file
There are several issues with your code. I will attempt to fix most of them below. %create some random data tw1=rand(148,3); ...

plus de 5 ans il y a | 1

Réponse apportée
How to restore a deleted/tampered question?
As an example, I'm going to use a thread that was recently edited: https://www.mathworks.com/matlabcentral/answers/665533-how-ca...

plus de 5 ans il y a | 8

Question


How to restore a deleted/tampered question?
Sometimes users remove major parts of their question, which makes the answers/comments much less useful for future readers. The ...

plus de 5 ans il y a | 1 réponse | 10

1

réponse

Réponse apportée
HTML Page source info
One possibility with strfind: close_div=strfinf(d,'</div>'); param=1; pat=sprintf('<label>Parameter%d : </label> <div class...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
set value of a variable according to date
No need to convert to a numerical date: d1 = datetime('01-March-2020'); d2 = datetime('31-May-2020'); date=datetime('10-March...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Saving an image file, text formatting lost.
There are two renderers in Matlab. Each has their specific use, but the saveas function sometimes switches to the other renderer...

plus de 5 ans il y a | 0

Réponse apportée
Problem in the for loop
You are using a syntax that only works on Octave, not Matlab. You don't reset your error at the start of every iteration, so ...

plus de 5 ans il y a | 0

Réponse apportée
How can I save the beginning and end positions of each sequence in a cell array?
%Since your code is working fine you can keep it as is. %I just used my own function to use your data. x_conv=readfile('https:...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
when i am executing the below code in matlab R2014a i am getting error Function defnitions are not permitted in this context can you please resolve the issue?
The error sounds like you have code before this in the same file. You need a newer version of Matlab to have a function defined ...

plus de 5 ans il y a | 0

Charger plus