Answered
Why do you come to "MATLAB Answers"?
Addiction: 1) Lend a hand. 2) Being helped.

7 years ago | 1

Answered
How can I plot a function with a conditions in a simple way?
w = -5000:5000; M = -w.*(w-5000) .* (w >= 0 & w <= 5000) +... -w.*(w+5000) .* (w >= -5000 & w <= 0); plot(w,M)

7 years ago | 0

Answered
Extracting Data from Cells
vv=cellfun(@(x) x(:,1:3),cross_sections,'un',0); % assuming the first three columns in each cell represents x,y & z v=cat(1,vv{...

7 years ago | 0

| accepted

Answered
Finding a word in text file
s=fileread('sample.txt'); % your text file's name W = regexp(s,'Student Number: (\w*)','tokens'); Wanted = [W{:}].'

7 years ago | 2

| accepted

Answered
Sub-Matrices in a bigger matrix
blkdiag(A11, B11, C11, D22)

7 years ago | 1

| accepted

Answered
Run one line or the other Option
Certainy not sure what you want to do but see if https://in.mathworks.com/help/matlab/ref/msgbox.html does what you want.

7 years ago | 0

| accepted

Answered
part of file name
s=' Hello_World_2020 '; [~,Wanted]=regexp(s,'_(.*)_','match','tokens'); Wanted{:}

7 years ago | 0

Answered
Make one column from two columns
a1=a(:,1); % a your data a2=a(:,2); b1=reshape(a1,6,[]); b2=reshape(a2,6,[]); z=zeros(6,numel(a)/6) % assuming it's divisbl...

7 years ago | 1

| accepted

Answered
How to select strings using regexp?
v = regexp(cell_array,'(HQ)\d+','match'); Wanted = [v{:}]

7 years ago | 0

| accepted

Answered
Finding unique set from large dataset
a = cellfun(@(z)regexp(z,'.','match'),x,'un',0); Output = num2cell(unique([a{:}]))

7 years ago | 1

| accepted

Answered
Full change of array?
You don't need a loop at all !: repelem(i,numel(j)*numel(k)-1:-1:numel(i)) % according to your output in the example % or perh...

7 years ago | 0

Answered
how to search and delete the nth ocurance of a text in a text file
s = fileread('test.txt'); v = regexp(s,'\n','split'); z = regexprep(s,'John is happy','',2) % 2 denotes the nth occurence dlm...

7 years ago | 0

| accepted

Answered
importfile regexp thousands separator returns NaN when negative
str2double(regexprep(numbers,',',''))

7 years ago | 0

| accepted

Answered
how to add one element in matrix?
A = [z,A]

7 years ago | 0

Answered
setting in command window in Matlab?
https://in.mathworks.com/matlabcentral/answers/182333-if-my-editor-window-became-undocked-how-do-i-dock-it-again-picture-inside#...

7 years ago | 0

Answered
how to write 12 digit after comma
format longg E=sscanf(D,'%f')

7 years ago | 0

| accepted

Answered
I need to create a cell array initializing each element in it to 3*1 null matrix.
Simpler without loop: F(:) = {zeros(3,1)}

7 years ago | 0

| accepted

Answered
Problem using ODE45 function
You haven't defined sigma anywhere , I suggest you use a different name for example Sigma because there exists a function named...

7 years ago | 0

| accepted

Answered
I need Personal Invoice
If you have bought any of the MATHWORKS product , you should be better of contacting Mathworks Support Team by click the Contact...

7 years ago | 0

Answered
How do I use two nested for loops to store the calculated values from a given equation in a 2 dimensional array?
% With Loop t=[0,0.1,0.2,0.3,0.4]; f=[0,0,10,15,20]; M = numel(t); N = numel(f); X=zeros(M,N); for ii = 1:M for jj = ...

7 years ago | 0

| accepted

Answered
Sum according to the values in another column
[u,~,idx]=unique(C1(:)); Wanted = [u,accumarray(idx,C2,[],@sum)]

7 years ago | 1

Answered
Error Using a loop: Conversion to double from cell is not possible.
Proj = cell(10,1); % outside loop Proj{w} = ... % inside loop , leave the rest unchanged

7 years ago | 3

Answered
How do i create an even space matrix
Wanted = Start:increment:End doc colon

7 years ago | 0

Question


What is crystal ball?
I have seen some comments by some of the answered referring to crystal ball, been bugging for days. Does it actually suggest you...

7 years ago | 1 answer | 1

1

answer

Answered
Extracting numbers from array of cells
V = regexp(my_data_string,'\d+[\.]?\d*','match','once'); Wanted = str2double(V) % or Wanted = str2double(my_data_string) %...

7 years ago | 0

| accepted

Answered
Not enough input argumaents
https://in.mathworks.com/help/matlab/ref/function.html - I suggest you to read it for better understanding and further usage x ...

7 years ago | 0

Answered
Convert Column Vector to arrey matrix
Matrix = reshape(vector,20,25).'

7 years ago | 0

Answered
making sub arrays of first column depending on the second column number
Wanted = splitapply(@(x){x},a(:,1),findgroups(a(:,2))) % where a is your matrix celldisp(Wanted)

7 years ago | 1

| accepted

Answered
[DISCONTINUED] MATLAB Answers Wish-list #5 (and bug reports)
Whenever a text is edited by mobile [safari browser] , the click produces superfluous three letters " ltr " , which is really fr...

7 years ago | 1

Load more