Réponse apportée
reverse indexing with conditions
idx = 1:numel(A); mask = A < 5; idx = idx(mask);

presque 10 ans il y a | 0

| A accepté

Réponse apportée
I need to make a continuous timer
If you want to measure performance in real time (i.e. seconds), you can use the functions tic() and toc() which start and _read_...

presque 10 ans il y a | 0

Réponse apportée
Using for loops to generate an array?
m = 7; n = 6; A = zeros(m,n); for i=1:m A(i,:) = i:i:i*n; end This should work for any size array with rows m and c...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
Color of hyperlinks in Answers posts
It's because a link you're putting in your post is most likely a webpage you've viewed recently. Chrome defaults recently viewed...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Keep getting Matrix dimensions must agree warning
You need to use element by element division, which is "./".

presque 10 ans il y a | 0

Réponse apportée
How can I find the second and third, etc. most frequent character in say a list of words (cell array of strings)?
a = unique(myStr); n = histc(myStr,a); [n,idx] = sort(n); myFreq = myStr(idx); Now myFreq will be the unique characters ...

presque 10 ans il y a | 0

Réponse apportée
Ho to enter this equation and plot it
Well you can't do either right matrix or element by element division on the vectors X and w. X is 1x41 while w is 1x2. I'm assum...

presque 10 ans il y a | 0

Réponse apportée
load txt files with columns of numbers and text
Try: fid = fopen('myFile.txt'); data = textscan(fid,'%s%s%d%d%d%d%s%d%d%d%d%d%d%d'); fclose(fid); This will read y...

presque 10 ans il y a | 0

Réponse apportée
Looping through a 3D matrix
for i = 1:144 for j = 1:43 for k = 1:35 myVal = myData(i,j,k); %do something end end...

presque 10 ans il y a | 0

Réponse apportée
How do I create a single line plot (just one line) with two differently scaled y-axes?
You can use plotyy() to plot two lines on top of each other so you only see one line. If the colors need to be the same, you can...

presque 10 ans il y a | 0

Réponse apportée
How do I determine if a word has a certain character in it?
If you only want to know whether or not the letter is in the word... hasLetter = any(myWord == 'c');

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Excluding files with a certain keyword in them
Assuming you have the file name as a variable, I'll use myName: myName = lower(myName); idx = strfind(str,'composite'); i...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
How to stop overwriting the old values from a loop inside a GUI?
I'd put k and ng as handles on the dialog box figure. myGUI.k = 1; myGUI.ng = 3; Then, function myCallback(varargi...

presque 10 ans il y a | 0

Réponse apportée
How to use text scan?
You can use textscan(fileID,'%s %s %s %s'); That will read all your data in. Only the last entry will matter, since tho...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Problem with find function
Modified code: hbs_ort = {'North' 'North' 'South' 'South' 'East' 'West' 'West' 'East'}; cabs_ort = 'North'; match=strfi...

presque 10 ans il y a | 1

Réponse apportée
check if user pressed the button "OK" in msgbox
Use questdlg instead. h=questdlg('Please press OK','something','OK','OK'); switch h case 'OK' %'OK' code here...

presque 10 ans il y a | 0

Réponse apportée
How to shade the area bounded by curves
This should do it. Modified from <http://www.mathworks.com/matlabcentral/answers/13233-plotting-linear-inequality-and-triangles ...

presque 10 ans il y a | 0

Réponse apportée
Why does xlswrite not replace file when I tell it to?
You could fill the file with empty cells, or there's a solution <http://www.mathworks.com/matlabcentral/newsreader/view_thread/2...

presque 10 ans il y a | 0

Réponse apportée
Read data from textfile
You could write something like data.txt: .25 .5 .75 1 .1822 .1751 ...etc. Then use something like textscan() or just ...

presque 10 ans il y a | 0

Réponse apportée
Is there a shortcut for selecting the word under the cursor in MATLAB?
You could use shift + arrow to move to the beginning/end of a word, then shift + control + arrow in the opposite direction to se...

presque 10 ans il y a | 2

| A accepté

Réponse apportée
How can i get points table from output graph in matlab?
p = plot(xValues,yValues); myX = get(p,'xdata'); myY = get(p,'ydata');

presque 10 ans il y a | 0

Réponse apportée
can a 2014 matlab program run on 2015 matlab?
It should, though is the possibility of incompatibility, but since the versions are only a year apart, I doubt there would be is...

presque 10 ans il y a | 0

Réponse apportée
Decrypting a message in matlab?
There are 3 things which don't work with your code: # It doesn't work when the key is >26. # Your checks for whether or not ...

presque 10 ans il y a | 0

Réponse apportée
GUI Figure Hide bottom part of figure
I'd say if you really needed the extra part to reveal from the bottom, you can write a resize function which adjusts the positio...

presque 10 ans il y a | 0

Réponse apportée
Where to find a complete list of supported class names for 'set' command?
I don't think such documentation exists. The issue is that set() is an extremely generic. Its function differs wildly with what ...

presque 10 ans il y a | 0

Réponse apportée
Finding a letter or number in a string of cells
out = {}; for i=1:numel(myData) myStr = myData{i}; myNum = str2double(myStr(myStr>= 48 & myStr <= 57)); m...

presque 10 ans il y a | 0

Réponse apportée
Using strings as variable names in a for loop
Have you tried stepping line by line using the debugger? You'll notice that in the line C=zeros(myvar); You're trying t...

presque 10 ans il y a | 0

Réponse apportée
Show value of an array in a messagebox
msgbox() doesn't give you a lot of options with the formatting. If you want to move the text to the right, you can add an icon. ...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Code to encrypt a string?
There are tons of Caesar Cipher resources out there. <http://www.mathworks.com/matlabcentral/fileexchange/39620-caesar-cipher...

environ 10 ans il y a | 1

| A accepté

Réponse apportée
Encrypting a Message with secret code?
There are tons of Caesar Cipher resources out there since it's a pretty basic problem in computer science courses. <http://ww...

environ 10 ans il y a | 0

| A accepté

Charger plus