Community Profile

photo

Karim


Last seen: Today 2016년부터 활동

Mechanical Engineer

Programming Languages:
MATLAB
Spoken Languages:
English
Professional Interests:
Optimization, Multibody Modeling, Finite Element Analysis (FEA)

Statistics

All
  • 6 Month Streak
  • Editor's pick for Answers
  • Knowledgeable Level 4
  • Community Group Solver
  • MATLAB Central Treasure Hunt Finisher
  • Explorer
  • First Review
  • Promoter
  • First Answer
  • Scavenger Finisher
  • Solver

배지 보기

Content Feed

보기 기준

답변 있음
How to sort a part of a given array?
Hi, below you can find some example code to demonstrate how to sort the first 'nSort' elements of a given vector. % create a ve...

3일 전 | 0

답변 있음
Using 'for loop' to plot
It's not really clear why you would like to use a loop since the vectorized method is a lot cleaner from a code perspective. How...

7일 전 | 0

| 수락됨

답변 있음
How to create a scatter plot with multiple data
Hello, see below for a demonstation on how to make the scatter plot. Note that it uses a 'crude' way to define the dates, proba...

12일 전 | 0

문제를 풀었습니다


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

27일 전

문제를 풀었습니다


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

27일 전

문제를 풀었습니다


Create a vector
Create a vector from 0 to n by intervals of 2.

27일 전

문제를 풀었습니다


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

27일 전

문제를 풀었습니다


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

27일 전

문제를 풀었습니다


Find max
Find the maximum value of a given vector or matrix.

27일 전

문제를 풀었습니다


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

27일 전

문제를 풀었습니다


Inner product of two vectors
Find the inner product of two vectors.

27일 전

문제를 풀었습니다


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

27일 전

문제를 풀었습니다


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

27일 전

문제를 풀었습니다


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

27일 전

답변 있음
finding the distance between two points
To identify the distances between the nodes of a segment you first need to identify the nodes that make up that segment. Once yo...

28일 전 | 0

답변 있음
How to calculate repeated calculation using LOOP?
Note that you can add data (e.g. a .mat file) to your question using the paperclip symbol. Without it is is difficult to validat...

28일 전 | 0

| 수락됨

답변 있음
Creating rainbow coloured plots in 3d
This can be done with the patch command, see below for a demonstration numPoints = 100; % create a random line Grid = zeros...

28일 전 | 0

답변 있음
What are the obs values in this spherical surface equation?
I added some comments in the code below. % define the center of the sphere (i.e. the location of the centroid of the sphere) c...

28일 전 | 3

| 수락됨

답변 있음
How to automatically run all matlab files in a folder
something like this should work folder = 'YourFolder'; mfiles = dir(fullfile(folder, '*.m')); % loop over the files for k ...

28일 전 | 1

답변 있음
How do I plot the relative error for each iteration vs. iteration number?
Hey, you need to save the value in order to plot it. I added an extra variable (ea_plot) to achieve this, see below. A = [4 1 2...

28일 전 | 1

답변 있음
Periodically fill scatter3
you can use the 'hold on' command to preserve the figure and add information to it, see below for an example % create an empty ...

28일 전 | 0

| 수락됨

답변 있음
How do I create a matrix from another matrix excluding values?
Hi, see below for a two step procedure to do this. Example = [ 5 0 2022 820 7 1 820; 5 1 2022 813 4 9 805; 5 2 2022...

28일 전 | 0

| 수락됨

답변 있음
For loop only working/filling cell array for half of data
One issue was the reuse of the variable name "x" directly after entering the loop, you overwrite your orinal data by removing el...

29일 전 | 0

| 수락됨

답변 있음
How to pull data from a table from a file and use as a string or cell.
Hi Terry, See below for one example on how to do this. This idea is to first use some logic operators to determine if the code ...

약 1달 전 | 0

| 수락됨

답변 있음
Why do i keep on getting error 'Not enough input arguments' on calling the function?
See below for the modified version. There were two issues: You need to call the function with two inputs: the array and the in...

약 1달 전 | 0

| 수락됨

답변 있음
for loop skipping an iteration
I would use a separate variable for the for-loop. See below with the adjusmtents. n = [10 100 1000]; for i = 1:numel(n) ...

약 1달 전 | 0

| 수락됨

답변 있음
How to do vector loop equation?
The syntax for the solve function works a bit different, see below for a demonstration. Notice that if you have a set of two eq...

약 1달 전 | 0

답변 있음
How to combine 2 function handles of different variables?
You need to add the input parameter in order to evaluate the functions. See below for demonstration using some random inputs. Y...

약 1달 전 | 1

| 수락됨

답변 있음
Extracting survey data from individual files and combining
I used the text files from your comment to update my answer, to (hopfully) better fit it to what you are looking for. I was not...

약 2달 전 | 0

| 수락됨

답변 있음
fprintf two 3x1 matrix's w/ text
Make sure that you add an end of line character "\n" to the end of the fprintf statement, otherwise evrtything will be printed o...

약 2달 전 | 1

| 수락됨

더 보기