Answered
Cannot open any file or create a new script
Try reinstalling the software or contact Mathworks Support Team by clicking the Contact Us button on the top right corner of thi...

7 years ago | 0

| accepted

Answered
Vertical line to the plot when ylimit is manually set to [0 inf]?
ylim([0 inf]) % ^-—-—-—-^-—-— missed it

7 years ago | 0

Answered
minimum of the function f(x)=cos(x2)
doc fminbnd

7 years ago | 1

Answered
Matrix dimensions must agree
First for some reason you make t twice as large than it previously was t=[t -t] % see here And then you try to multiply it wi...

7 years ago | 0

| accepted

Answered
Read specific column from the text file and how to store the values into the matrix/vector?
From the previous question:https://www.mathworks.com/matlabcentral/answers/443436-read-first-column-from-the-text-file#answer_35...

7 years ago | 0

| accepted

Answered
Read first column from the text file
fid = fopen('sample.txt') % ^^^^^^^^^^----- your filename formatspec=['%f',repmat('%*f',1,5)]; % 5 represents total...

7 years ago | 0

| accepted

Answered
fminsearch, Function arguments must be symbolic variables, and function body must be sym expression.
funfun = @(z) abs((fun31(z)-10).*(fun3(z)-178.57145)); % ^----removed it fminsearch(funfun,[0.002,0.04])

7 years ago | 0

| accepted

Answered
How to find the fifth largest value in a matrix
Hint: https://www.mathworks.com/help/matlab/ref/maxk.html

7 years ago | 0

Answered
save each loop data in one csv file
EDITED: M=10; N=15; solutions=zeros(M,N); for k=1:M solutions(k,:)=randperm(N); end dlmwrite('file1.csv',solutions)

7 years ago | 0

| accepted

Answered
matlab ode45 error
[t,y]=ode45(@maths,...)

7 years ago | 1

| accepted

Answered
how to jump a single for step in a for loop?
if ... continue % just add this inbetween end

7 years ago | 2

| accepted

Answered
Finding roots of trigonometric equation
Roots=solve(vr,theta,'maxDegree',4)

7 years ago | 1

| accepted

Answered
i have a martix A, i want missing numbers in the 2nd column as i explained? any help??
Alternative: T=array2table(A); fun=@(x) setdiff(min(A(:,1)):max(A(:,2)),x); C=rowfun(fun,T,... 'GroupingVariable','A1',....

7 years ago | 1

| accepted

Answered
i have a martix A, i want missing numbers in the 2nd column as i explained? any help??
The below works for n numbers in the first column: Min=min(A(:,2)); Max=max(A(:,2)); [a,b,c]=unique(A(:,1)); B=diff(b.')...

7 years ago | 1

Answered
Publishing this only gives me part of the graph, i want the full graph to show! HELP!!!!!
xlim([-1 1]) % add the the end ylim([-1 1])

7 years ago | 0

Answered
Why is my sum outputting a curly bracket?
num2str(sum(2:2:200)) I recommend to use fprintf('Sum of even numbers from 2 to 200: %d',sum(2:2:200))

7 years ago | 0

Answered
How do I display numeric values in a struct?
sol.F2 % use dot indexing

7 years ago | 2

| accepted

Answered
INVERT first three rows of results
Alternatively: results(1:3,[1 2])=results(1:3,[2 1])

7 years ago | 1

| accepted

Answered
INVERT first three rows of results
results(1:3,:)=fliplr(results(1:3,:))

7 years ago | 1

Answered
Multiply each individual cell by a single matrix
Result=cellfun(@(x)x*matrix,Cell,'un',0)

7 years ago | 1

| accepted

Answered
How can I store all the values of for loop in a single variable
In your case its simply a=i but you have asked it for clarifcation so the illustration is as follows: i=17.890:0.005:17.920; a...

7 years ago | 0

| accepted

Answered
Is MATLAB case sensitive in all aspects?
Yes. Since it’s a character vector , inside the function there could be some functions internally used to match it but the comma...

7 years ago | 1

Answered
How can i generate this array with matlab?
https://www.mathworks.com/help/matlab/learn_matlab/array-indexing.html

7 years ago | 0

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
V(i+1) = V(i) + dt * ((E_l - V(i))/R_m + (I_app(i)))/ C_m; % (vii) forward Euler %...

7 years ago | 0

| accepted

Answered
Unkown Source of "Index in position 1 exceeds array bounds" error in simple line plot.
clear plot % at the very beginning plot seems to be a variable stored in the workspace

7 years ago | 1

| accepted

Answered
how to creat this transformation?
B=A; index=find(A); idx=find(diff(index)~=1); b=[idx(1) diff(idx) numel(index)-idx(end)]; R=mat2cell(A(index),1,b); C=cellf...

7 years ago | 1

Answered
Undefined function or variable 'rgb2lin'.
https://www.mathworks.com/help/images/ref/rgb2lin.html#mw_39c65192-b3aa-4e13-bbd2-84e3d3478579_seealso - released in 2017b so in...

7 years ago | 0

Answered
Cropping a vector with on repeating target values
V(1:find(V==1,1,'first')-1)

7 years ago | 0

| accepted

Answered
Extracting double from endless serial string
str2double(regexp(Live,'(?<=+.*)(\d+)?.?\d*(?=X)','match')).'

7 years ago | 1

Answered
when ploting the left y axis always be the bule I can not change the color
ax = gca; ax.YAxis(1).Color = 'b'; %left axis color ax.YAxis(2).Color = 'r'; %right axis color

7 years ago | 0

Load more