已回答
Resize a matrix into another with different size
Hi, Try this: k = 26; X = [1:k]'; [n,m] = size(X); rows = 4; columns = ceil(n/rows); X(numel(X):(rows*columns)) = NaN;...

6 years 前 | 1

已回答
How can I put a struct output into the i-th field of a struct on MATLAB?
Hi, You can do it as follows: After that you have out.S as an array so you can assign it to any other struct. for i =1:Number...

6 years 前 | 0

已回答
How to eliminate unwanted grids on the z-axis?
Hi Edward, Maybe this can solve your problem: set(gca,'XMinorGrid','off'); set(gca,'YMinorGrid','off'); set(gca,'ZMinorGri...

6 years 前 | 0

| 已接受

已回答
How to find values of variables?
Use divide operator directly to solve Ax = B type linear equations. Here is the link. mldivide

6 years 前 | 0

已回答
Storing Data into a Matrix from a for loop
Hello Estevan, Try this: position = zeros(1,1000); tails = 0; heads = 1; for s = (1:1000) x=randi([0 1]); ...

6 years 前 | 0

已回答
How to Calculate linear trend for each column of a matrix
Hi, I think you can use polyfit simply for this problem. Here is an example code. You can apply it for the other columns asw...

6 years 前 | 0

已回答
Using save(Filename) in a Callbackfunction of a button
"Does hObject include all GUI objects in the function workspace?" According to that, if you define all of your uicontrol elemen...

6 years 前 | 1

已回答
how I do it. the function is called a string is passes a numbr
Hello Dezdi, You can do it by first collecting your inputs in a cell array and then call your function in a for loop with 5 el...

6 years 前 | 0

已回答
Help With Bar Position
Hi Naomi, You can add zero value bars to add it to further I think. Try that below: %Data Data=[8 12] %Percent Increase ...

6 years 前 | 0

已回答
How can I create a function that inputs a row
Hi, Your return value should be written like below for functions. Your inputs should be written inside the paranthesis. fun...

6 years 前 | 0

已回答
How can I fit a curve to x, y points and obtain the regression?
Hello Sarah, you can use polyfit. It uses least squares, here is the link you can read about it: polyfit

6 years 前 | 0

已回答
Can I use fullfile() to read two subfolders ?
Hello Yanagawa, You should use for loop for that operation to get one by one each folder path. Try this (also detects all fol...

6 years 前 | 1

| 已接受

已回答
How can I add legend or color index to my scatter function
Hi please check the legend function below: Legend

6 years 前 | 0

已回答
xlsread error, wont open file
Hello Anthony check the inputs of xlsread function. First input should be the full file name with path or if your matlab‘s cur...

6 years 前 | 0

已回答
I have a code but it keep saying "invalid expression. when calling a function or indexing a variable, use parentheses. otherwise check for mismatched delimiters.
Hi Roolientha, Your expression is invalid because you are calling a function sin with brackets not paranthesis. sin[..] %c...

6 years 前 | 2

| 已接受

已回答
Create 3D matrix with 1s in certain position and all other elements 0s (NO FOR LOOP)
Hi Pietro A = zeros(3,5,5); site = [1,2,3,4,5]'; for i = 1:numel(site) A(:,site(i),site(i)) = ones(1,3)'; end This might ...

6 years 前 | 0

已回答
How can I remove entire rows from a table based on NaN values in a specific column (cell data type) in a table?
Hello Jens, Please try this: idx = find(cell2mat(cellfun(@(x) strcmp(num2str(x),'NaN'), input.var2, 'UniformOutput', false))...

6 years 前 | 0

已回答
How to split time in to hours, minutes and nanoseconds
Hi, Run this code format long then run your tt you will see long format in your command window.

6 years 前 | 0

已回答
I have tried to make a loop where it displays all the answers in a matrix but it doesn't give me the 21x3 matrix. Am i using wrong commands or am i missing something.
Hi Merlin, try this code below: v = []; for t = 0:1:20 v(t+1,:) = [t,sin(t),cos(t)] ; end

6 years 前 | 0

| 已接受

已回答
help me with implementing simple funtion
Hello Aydin, Have a look at this str2func. It converts string into function. If you want to declare your PLearn and PRecall in...

6 years 前 | 0

已回答
I am receiving an error in my script when calling a function.
Hi, While you are calling your function in case ‘1’ you should just call like below: check_inputs(L,B,T,C,U,S,t,time) I did...

6 years 前 | 0

已回答
How create a programm which create new menu item in matlab
Hi Daniel, You should check the help documentations of MATLAB’s built-in functions below: uimenu, uicontrol, figure, uitable...

6 years 前 | 0

已回答
How do i accept only numbers as input to forward to a switch case ?
Hi Nabeel, You can check that after getting the velocity and before your switch by using a flag isnumeric(velocity). It returns...

6 years 前 | 0

已回答
Disable the "did you mean" feature
Hi Federico, Could you please check the link below you might find what you need in Display Options. Command Window Prefere...

6 years 前 | 0

| 已接受

已回答
Edge Detection without function
Hello Fifit, Signal should be a vertical vector. Value is a constant double. Index is the result which is a logical array wh...

6 years 前 | 2

已回答
Bubble sorting (Index exceeds the number of array elements)
Hi Karolina, I always use xlsread instead of fopen. It is always easier to see what's going on with cell arrays or table st...

6 years 前 | 1

| 已接受

已回答
I would like to separate a matrix into different matrices based on a cycle of the first values
Hi Adolf, As far as I understand from your question. The cycle means that if your data is smaller than the previous data acc...

6 years 前 | 0

已回答
How do I use relational and logical operators to find specific function values?
You can do it without creating z1 and z2. But you can't do it without creating H and V. You have to create your functions outpu...

6 years 前 | 1

| 已接受

已回答
How to extract columns from cells in a cell array
Could you please try: output(k) = warp(p,q); Because each time your output changes and it overrides your single scalar...

6 years 前 | 1

| 已接受

已回答
How to do this in Matlab?
Hi Shing I can only recommend you which functions you should look at with their links below: 1) First look at randn funct...

6 years 前 | 0

| 已接受

加载更多