Answered
search for elements of a vector in a matrix (without using ismember)
[EDITED Wrong approach:] You can save some time with calling the internally used C-Mex function: bs = sort(b); % Omit i...

9 years ago | 3

Answered
Coding distance between three fixed co-ordinates A, (6,5) B, (12,15) C (28,10) and a variable point P (x, y).
How would you solve it with pencil and paper? Or perhaps if you have a compass? Start with a sketch: Draw 3 arbitrary point and ...

9 years ago | 0

Answered
How can i store data from a loop into different variables? instead of storing in a vector/matrix. I want to use the different z values for something else. Hoping it could be stored into z(1) and z(2) or some sort. Thanks.
Don't do this. See : * <https://www.mathworks.com/matlabcentral/answers/57445-faq-how-can-i-create-variables-a1-a2-a10-in-a-l...

9 years ago | 0

Answered
Position of an element in a vector
Remember the old FAQ: Why does any((0:0.1:1) == 0.3) reply |false|? See <https://www.mathworks.com/matlabcentral/answ...

9 years ago | 0

Answered
Replacing NaN with some specific values in a mix data type of cell.
Start with a simple loop: for iC = 1:numel(C) aC = C{iC}; if isfloat(aC) && ~isempty(aC) % Only SINGLE and DOUBL...

9 years ago | 1

| accepted

Answered
print + sign in ans
This is a homework question, but you have shown an almost working code already. I only clean it up a little bit: m = input(...

9 years ago | 0

Question


Tags in the forum
I do not see the tags in the display of a question anymore. Therefore I cannot edit them also. While typing the question, I can ...

9 years ago | 2 answers | 1

2

answers

Answered
Is there a way to convert table consists of many variables to matrix ?
It depends on what "table consisting of many variables" is. A |table| object and you are looking for the function |table2array|?...

9 years ago | 0

Answered
only one column with pop up window and import data into row
1st question: "I just want this for a specific column" Try this: datatable_row = eventdata.Indices(1); datatable_col ...

9 years ago | 0

Answered
Writing 3D data into text files
You are talking about 65536 numbers. Text files are useful, if they are read or edited by a human, but nobody will read and unde...

9 years ago | 0

Answered
column vector with specified number
a = randi([2,3], 1, 10)

9 years ago | 0

Answered
Use terminal to speed up file removal
I'm not sure if I understand your question correctly: You want to delete all files, which have one column only - correct? FUL...

9 years ago | 0

Answered
My matlab code is giving me this error "Too many outputs requested". If someone can help me solve this?
u_m_pos=find(u_arr == min(u_arr)); gt_ewn=tmpe_cell{u_m_pos}; The message appears, if the minimal value ...

9 years ago | 0

Answered
What is wrong in this code??
In this loop: while abs(res1)>0.01 As = vq.*(Us(j).^2)./(16.*(pi.^2).*msksi.*fs1(j)); res1 = As1(i)-As; end...

9 years ago | 0

| accepted

Answered
Show all decimal places
Matlab stores floating point values in the IEE754 format, which store them as binary values. Remember that binary numbers need n...

9 years ago | 1

Answered
Moving files in matlab
"//DTI_scans/1005/DATA" is a strange UNC path. Usually you have "//Host/Folder/" fixed, because this is the published path. The ...

9 years ago | 1

Answered
Error while evaluating UIControl Callback
You cannot multiply cells, but only the contents: for v = 1:gen+1 Data{v,2} = rate * Data{v,1}; % Curly braces en...

9 years ago | 0

| accepted

Answered
Sort & Index matrix for highest values in row
x = randi([0,20], 5, 5); [~, index] = sort(x, 2, 'descend'); % Sorting index result = zeros(...

9 years ago | 2

| accepted

Answered
Longest segment of successive numbers of a sequence
a = [ 1 2 7 8 3 9 4 7 2 5 7 8 9]; ind = find([true, a(2:end) < a(1:end-1), true]); len = diff(ind); [maxLen, p] = m...

9 years ago | 0

Answered
How to change the x axis of hue histgram from number to degree value?
What about multiplying the x value by 360? If you ask an internet search engine for images concerning "hue 0 to 360" you find...

9 years ago | 0

| accepted

Answered
Getting MD5 hash of files with "bad" names (Windows, NTFS)
I think, that the problem occurs in % dirinfo(i).name - is string containing full pathname (e.g. 'C:\myfile.ext') and ...

9 years ago | 0

Answered
How to implement the integration
This is 0.5 * t^2 + C with C is a constant expression depending e.g. on the initial value of t. For t(0)=0, C is 0 also. Do y...

9 years ago | 0

Answered
How can i make a code for following differential equation?
y = (n==1)*10 is not meaningful is n = 2:50. Start with a simple loop: y = zeros(1, 50); y(1) = 10; for k = 2:5...

9 years ago | 0

Answered
Error while evaluating Menu Callback
I guess that you have destroyed the filemenufcn.m file. Open it in the editor to check this. If this is the problem, avoid to...

9 years ago | 0

| accepted

Answered
Count numbers from 0 to a value input by the user in uitable
n = input('Number of rows: '); Data = cell(n+1, 3); Data(:,1) = num2cell((0:n).'); f = figure; t = ...

9 years ago | 0

| accepted

Answered
integrating a Pop-Up Menu into a column of a uitable, is this even possible? If yes how?
If you want a context menu for a |uitable|: There is none. You could create one manually with Java tricks to determine which cel...

9 years ago | 1

| accepted

Answered
Adding items in the legend as the number of curves on the plot increases
NameC = sprintfc(formatSpec, a); legend(Namec{:}); % or legend(NameC); Unfortunately |sprintfc| is not documented....

9 years ago | 0

| accepted

Answered
How can I insert an array into k of nchoosek?
Whenever you mention that you get an error, post a complete copy of the message. Do not let the forum guess, what you can see di...

9 years ago | 0

| accepted

Answered
x(t)=exp(-t)cos(15πt), -3<=t<=3
|linspace| helps to create |t|: doc linspace Then x can be calculated directly, if you consider to use * for the multipl...

9 years ago | 0

Answered
I want to loop a value into a vector, how do I do this?
Your D_N is overwritten in each iteration. Perhaps you want: D_N(:, m) = sqrt(mean(D)) Are you sure with |sign(randn)|?...

9 years ago | 0

Load more